null pointer dereference - (ParticleSystemParticles::CopyToArrayAOS) after Unity Update

Hello I think I may be experiencing a bug in Unity due to the way I am saving and reloading particles between physics scenes.

First off here is the error I am getting.

Android Logs

04-12 09:28:01.812  3437  3538 E CRASH   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-12 09:28:01.812  3437  3538 E CRASH   : Version '2020.3.46f1 (18bc01a066b4)', Build type 'Development', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
04-12 09:28:01.812  3437  3538 E CRASH   : Build fingerprint: 'google/raven/raven:13/TQ2A.230305.008.E1/9677224:user/release-keys'
04-12 09:28:01.812  3437  3538 E CRASH   : Revision: 'MP1.0'
04-12 09:28:01.812  3437  3538 E CRASH   : ABI: 'arm64'
04-12 09:28:01.812  3437  3538 E CRASH   : Timestamp: 2023-04-12 09:28:01-0700
04-12 09:28:01.812  3437  3538 E CRASH   : pid: 3437, tid: 3538, name: Job.Worker 2  >>> com.breakstepstudios.commandcenterearth <<<
04-12 09:28:01.812  3437  3538 E CRASH   : uid: 10427
04-12 09:28:01.812  3437  3538 E CRASH   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x204
04-12 09:28:01.812  3437  3538 E CRASH   : Cause: null pointer dereference
04-12 09:28:01.812  3437  3538 E CRASH   :     x0  0000007671d95230  x1  000000772b467748  x2  0000000000000001  x3  0000000000000081
04-12 09:28:01.812  3437  3538 E CRASH   :     x4  000000772b4688a0  x5  000000772b4677d8  x6  000000006a1a66eb  x7  00000076d0027280
04-12 09:28:01.812  3437  3538 E CRASH   :     x8  0000000000000204  x9  000000772b46776c  x10 0000000000000000  x11 000000772b467778
04-12 09:28:01.812  3437  3538 E CRASH   :     x12 0000000000000001  x13 000000772b467748  x14 0000000000000204  x15 41d8cc8241f09564
04-12 09:28:01.812  3437  3538 E CRASH   :     x16 0000000000000000  x17 0000007a63a10fe0  x18 0000000000002ede  x19 000000772b467748
04-12 09:28:01.812  3437  3538 E CRASH   :     x20 0000007671d95230  x21 0000000000000000  x22 0000000000000081  x23 0000000000000001
04-12 09:28:01.812  3437  3538 E CRASH   :     x24 0000007671d95848  x25 000000772b4677c0  x26 0000000000000084  x27 0000007723771e30
04-12 09:28:01.812  3437  3538 E CRASH   :     x28 0000000000000081  x29 0000000000000002
04-12 09:28:01.812  3437  3538 E CRASH   :     sp  000000772b4676d0  lr  000000772298bf48  pc  00000077227eca44
04-12 09:28:01.812  3437  3538 E CRASH   : backtrace:
04-12 09:28:01.812  3437  3538 E CRASH   :       #00 pc 0000000000b6fa44  /data/app/~~RDoVFOH7CHhukFChKdwo_Q==/com.breakstepstudios.commandcenterearth-pqs_0V62gpIYLagrpQRwEw==/lib/arm64/libunity.so (ParticleSystemParticles::CopyToArrayAOS(ParticleSystemParticle*, int, int) const+176) (BuildId: 4e68e86bbb46cea51faef290d2c29a1f596cb4b6)
04-12 09:28:01.813  3437  3538 E CRASH   :       #01 pc 0000000000d0ef44  /data/app/~~RDoVFOH7CHhukFChKdwo_Q==/com.breakstepstudios.commandcenterearth-pqs_0V62gpIYLagrpQRwEw==/lib/arm64/libunity.so (ParticleSystemTrailGeometryJob::ConfigurePerParticleTrailParams(ParticleLineParameters&, ParticleSystemParticles const*, unsigned long, ParticleSystemTrailGeometryJob const&, float)+56) (BuildId: 4e68e86bbb46cea51faef290d2c29a1f596cb4b6)
04-12 09:28:01.813  3437  3538 E CRASH   :       #02 pc 0000000000d0daf8  /data/app/~~RDoVFOH7CHhukFChKdwo_Q==/com.breakstepstudios.commandcenterearth-pqs_0V62gpIYLagrpQRwEw==/lib/arm64/libunity.so (ParticleSystemTrailGeometryJob::RenderJobCommon(ParticleSystemTrailGeometryJob&, void*, unsigned int)+1608) (BuildId: 4e68e86bbb46cea51faef290d2c29a1f596cb4b6)
04-12 09:28:01.813  3437  3538 E CRASH   :       #03 pc 0000000000d0cca4  /data/app/~~RDoVFOH7CHhukFChKdwo_Q==/com.breakstepstudios.commandcenterearth-pqs_0V62gpIYLagrpQRwEw==/lib/arm64/libunity.so (ParticleSystemTrailGeometryJob::RenderJob(SharedGeometryJobData*, unsigned int)+100) (BuildId: 4e68e86bbb46cea51faef290d2c29a1f596cb4b6)
04-12 09:28:01.813  3437  3538 E CRASH   :       #04 pc 00000000005030a0  /data/app/~~RDoVFOH7CHhukFChKdwo_Q==/com.breakstepstudios.commandcenterearth-pqs_0V62gpIYLagrpQRwEw==/lib/arm64/libunity.so (JobQueue::Exec(JobInfo*, long long, int, bool)+120) (BuildId: 4e68e86bbb46cea51faef290d2c29a1f596cb4b6)
04-12 09:28:01.813  3437  3538 E CRASH   :       #05 pc 0000000000503388  /data/app/~~RDoVFOH7CHhukFChKdwo_Q==/com.breakstepstudios.commandcenterearth-pqs_0V62gpIYLagrpQRwEw==/lib/arm64/libunity.so (JobQueue::Steal(JobGroup*, JobInfo*, long long, int, bool, bool)+344) (BuildId: 4e68e86bbb46cea51faef290d2c29a1f596cb4b6)
04-12 09:28:01.813  3437  3538 E CRASH   :       #06 pc 00000000005034ec  /data/app/~~RDoVFOH7CHhukFChKdwo_Q==/com.breakstepstudios.commandcenterearth-pqs_0V62gpIYLagrpQRwEw==/lib/arm64/libunity.so (JobQueue::ExecuteJobFromQueue(bool, bool&)+172) (BuildId: 4e68e86bbb46cea51faef290d2c29a1f596cb4b6)
04-12 09:28:01.813  3437  3538 E CRASH   :       #07 pc 0000000000503958  /data/app/~~RDoVFOH7CHhukFChKdwo_Q==/com.breakstepstudios.commandcenterearth-pqs_0V62gpIYLagrpQRwEw==/lib/arm64/libunity.so (JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*)+912) (BuildId: 4e68e86bbb46cea51faef290d2c29a1f596cb4b6)
04-12 09:28:01.813  3437  3538 E CRASH   :       #08 pc 0000000000502a48  /data/app/~~RDoVFOH7CHhukFChKdwo_Q==/com.breakstepstudios.commandcenterearth-pqs_0V62gpIYLagrpQRwEw==/lib/arm64/libunity.so (JobQueue::WorkLoop(void*)+228) (BuildId: 4e68e86bbb46cea51faef290d2c29a1f596cb4b6)
04-12 09:28:01.814  3437  3538 E CRASH   :       #09 pc 00000000007044f4  /data/app/~~RDoVFOH7CHhukFChKdwo_Q==/com.breakstepstudios.commandcenterearth-pqs_0V62gpIYLagrpQRwEw==/lib/arm64/libunity.so (Thread::RunThreadWrapper(void*)+512) (BuildId: 4e68e86bbb46cea51faef290d2c29a1f596cb4b6)
04-12 09:28:01.814  3437  3538 E CRASH   :       #10 pc 00000000000c226c  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+204) (BuildId: dc4001c2ef2dfc23467040797a96840c)
04-12 09:28:01.814  3437  3538 E CRASH   :       #11 pc 0000000000054a30  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: dc4001c2ef2dfc23467040797a96840c)

And here is how I am saving and loading my particle system state (including trails)

ParticleSystemExtensions (Save & Restore Snapshots)

using UnityEngine;

namespace StudioName.Runtime.ExtensionAndHelpers
{
    /// <summary>
    /// Extends the <see cref="UnityEngine.ParticleSystem"/> class with additional functionality
    /// </summary>
    public static class ParticleSystemExtensions
    {
        /// <summary>
        /// Saves this point in time for the particle system in order to restore to this point in time later
        /// </summary>
        /// <param name="particleSystem">The particle system we are operating on</param>
        /// <param name="withChildren">If true will also snapshot the child particle systems as well, false will only save this particle system.</param>
        /// <returns>The snapshot/s to restore to later. If withChildren is false only first element will be filled</returns>
        public static ParticleSystemSnapshot[] SaveSnapshot(this ParticleSystem particleSystem, bool withChildren = true)
        {
            //don't save children so only snapshot current particle system
            if (!withChildren)
            {
                return new[] { SaveSnapshotInternal(particleSystem) };
            }
         
            //we want to save children as well so loop through and snapshot all of them returning them in order snapshotted
            var particleSystems = particleSystem.GetComponentsInChildren<ParticleSystem>();
            var snapshots = new ParticleSystemSnapshot[particleSystems.Length];
            for (var i = 0; i < particleSystems.Length; i++)
            {
                snapshots[i] = particleSystems[i].SaveSnapshotInternal();
            }
         
            return snapshots;
        }

        /// <summary>
        /// Restore the particle system to the point in time provided by the snapshots
        /// </summary>
        /// <param name="particleSystem">The particle system we are operating on</param>
        /// <param name="snapshots">The snapshot/s in time to restore the particle system (and potentially it's children) to. If withChildren = false only one particle system need be specified</param>
        /// <param name="withChildren">If true will also restore the children with the snapshots provided, false will only restore this particle system</param>
        public static void RestoreSnapshot(this ParticleSystem particleSystem, ParticleSystemSnapshot[] snapshots, bool withChildren = true)
        {
            if (!withChildren)
            {
                //throw an exception if we don't at least have one snapshot
                if (snapshots.Length <= 0)
                {
                    throw new System.Exception("No snapshots provided to restore to");
                }
                particleSystem.RestoreSnapshotInternal(snapshots[0]);
                return;
            }
         
            var particleSystems = particleSystem.GetComponentsInChildren<ParticleSystem>();
            //throw an exception if we don't have the same number of snapshots as particle systems
            //TODO we may not want to throw an exception here as maybe they only want to restore a subset of particle systems
            if (snapshots.Length < particleSystems.Length)
            {
                throw new System.Exception("Number of snapshots provided does not match number of particle systems.");
            }
         
            //restore all of our child particle system
            for(var i = 0; i < particleSystems.Length; i++)
            {
                particleSystems[i].RestoreSnapshotInternal(snapshots[i]);
            }
        }

        /// <summary>
        /// Restore the particle system to this point in time
        /// </summary>
        /// <param name="particleSystem">The particle system we are operating on</param>
        /// <param name="snapshot">The snapshot in time to restore the particle system to</param>
        public static void RestoreSnapshotInternal(this ParticleSystem particleSystem, ParticleSystemSnapshot snapshot)
        {
            particleSystem.SetPlaybackState(snapshot.playbackState);
            particleSystem.SetParticles(snapshot.particles, snapshot.particles.Length);
            particleSystem.SetTrails(snapshot.trails);
            //TODO the below may be buggy, double check returning to correct play state is working as it's supposed to later
            //if our particle was stopped when we saved our snapshot that means no particles were alive so clear them all
            //and don't continue below
            if(snapshot.isStopped)
            {
                particleSystem.Stop(false, ParticleSystemStopBehavior.StopEmittingAndClear);
                return;
            }
            //if we are paused we are not playing or emitting
            if (snapshot.isPaused)
            {
                particleSystem.Pause(false);
                return;
            }
            //if we were playing ensure we start things back up again
            if (snapshot.isPlaying)
            {
                particleSystem.Play(false);
            }
            //we may have been playing but called Stop(ParticleSystemStopBehavior.StopEmitting) when we saved the snapshot
            //bottom line make sure to stop emitting if that's what we were doing when snapshot was saved
            if (!snapshot.isEmitting)
            {
                particleSystem.Stop(false, ParticleSystemStopBehavior.StopEmitting);
            }
        }
     
        private static ParticleSystemSnapshot SaveSnapshotInternal(this ParticleSystem particleSystem)
        {
            var playbackState = particleSystem.GetPlaybackState();
            var particles = new ParticleSystem.Particle[particleSystem.particleCount];
            particleSystem.GetParticles(particles);
            var trails = particleSystem.GetTrails();
            return new ParticleSystemSnapshot
            {
                playbackState = playbackState,
                particles = particles,
                trails = trails,
                isEmitting = particleSystem.isEmitting,
                isPlaying = particleSystem.isPlaying,
                isPaused = particleSystem.isPaused,
                isStopped = particleSystem.isStopped,
            };
        }
     
        /// <summary>
        /// A snapshot of a point in time for a given particle system
        /// </summary>
        public struct ParticleSystemSnapshot
        {
            /// <summary>
            /// The playback state of the particle system snapshot
            /// </summary>
            public ParticleSystem.PlaybackState playbackState;
            /// <summary>
            /// The particles of the particle system snapshot
            /// </summary>
            public ParticleSystem.Particle[] particles;
            /// <summary>
            /// The trails of the particle system snapshot
            /// </summary>
            public ParticleSystem.Trails trails;
            /// <summary>
            /// Is the particle system emitting particles. See <see cref="ParticleSystem.isEmitting"/>
            /// </summary>
            public bool isEmitting;
            /// <summary>
            /// Is the particle system playing. See <see cref="ParticleSystem.isPlaying"/>
            /// </summary>
            public bool isPlaying;
            /// <summary>
            /// Is the particle system paused. See <see cref="ParticleSystem.isPaused"/>
            /// </summary>
            public bool isPaused;
            /// <summary>
            /// Is the particle system stopped. See <see cref="ParticleSystem.isStopped"/>
            /// </summary>
            public bool isStopped;
        }
    }
}

The code works fine on Unity 2020.3.12f1 but once I upgraded to Unity 2020.3.46f1 I ran into this issue. Another important change is that I did start targeting Android version 31 once I updated Unity (the reason I updated to begin with).

That said I wonder if this bug is occurring as a result of this fix?

Finally to give some context I use my extensions to save a my “particle snapshot” on one physics 2d scene and restore the “particle snapshot” when the object is moved into another physics 2d scene.

The strange part (and why I think it’s a bug) is because it will work fine sometimes and crash the game seemingly randomly other times.

From what I can tell I’m using the API correctly, but perhaps someone can shed light on if I’m doing something that would produce this error.

So after some investigation this looks to only be occurring on Android.

Also, after I cleared the app cache and data it looks like the bug has disappeared. However, it is possible the bug just hasn’t manifested again yet.

I wonder if some Unity / Android expert could chime in here and shed some light on if clearing the app cache / data could have fixed the bug. I have had instances where an old cache has manifested issues. Which is why I ask.

Thanks for any help in advance!

I was wrong about this only occuring on Android. The bug is now appearing on iOS as well. Here are the logs below.

# Crashlytics - Stack trace
# Application: com.breakstepstudios.commandcenterearth
# Platform: apple
# Version: 2.0.2 (55)
# Issue: 3d54a001d269d52bb25edb73a9d4f1df
# Session: 561227cd15f84ad484b158d4da6da1a7_DNE_0_v2
# Date: Wed May 03 2023 15:22:01 GMT-0700 (Pacific Daylight Time)

com.apple.main-thread
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b1408 JobQueue::WaitForJobGroupID(JobGroupID, JobQueue::JobQueueWorkStealMode) + 1841 (JobQueue.cpp:1841)
5  UnityFramework                 0x9aee74 CompleteFenceInternal(JobFence&, WorkStealMode) + 17 (Jobs.cpp:17)
6  UnityFramework                 0x6d92e8 ParticleSystemManager::ClearAllFences(bool) + 848428 (ParticleSystem.cpp:848428)
7  UnityFramework                 0x6d8fd8 ParticleSystem::SyncJobs(bool) + 661 (ParticleSystem.cpp:661)
8  UnityFramework                 0x6d8ebc ParticleSystem::smile:eactivate(DeactivateOperation) + 1914 (ParticleSystem.cpp:1914)
9  UnityFramework                 0x861f04 GameObject::ActivateAwakeRecursivelyInternal(DeactivateOperation, AwakeFromLoadQueue&) + 198 (GameObject.cpp:198)
10 UnityFramework                 0x861e8c GameObject::ActivateAwakeRecursivelyInternal(DeactivateOperation, AwakeFromLoadQueue&) + 191 (GameObject.cpp:191)
11 UnityFramework                 0x861e8c GameObject::ActivateAwakeRecursivelyInternal(DeactivateOperation, AwakeFromLoadQueue&) + 191 (GameObject.cpp:191)
12 UnityFramework                 0x861e8c GameObject::ActivateAwakeRecursivelyInternal(DeactivateOperation, AwakeFromLoadQueue&) + 191 (GameObject.cpp:191)
13 UnityFramework                 0x861e8c GameObject::ActivateAwakeRecursivelyInternal(DeactivateOperation, AwakeFromLoadQueue&) + 191 (GameObject.cpp:191)
14 UnityFramework                 0x861fac GameObject::ActivateAwakeRecursively(DeactivateOperation) + 225 (GameObject.cpp:225)
15 UnityFramework                 0x9e8124 UnityScene::HandleChangingPhysicsScenes(GameObject&, UnityScene*, UnityScene*) + 574 (UnityScene.cpp:574)
16 UnityFramework                 0x9e7704 UnityScene::OnGameObjectChangedScene(GameObject&, UnityScene*, UnityScene*) + 322 (UnityScene.cpp:322)
17 UnityFramework                 0xb365a4 SceneManager_CUSTOM_MoveGameObjectToScene_Injected(ScriptingBackendNativeObjectPtrOpaque*, int const&) + 65 (ScriptingNativeTypes.h:65)
18 UnityFramework                 0x2f94564 selector_thread(void*) (.cold.1) + 4524705124
19 UnityFramework                 0x1486628 selector_thread(void*) (.cold.1) + 4496336424
20 UnityFramework                 0x25c2274 selector_thread(void*) (.cold.1) + 4514407028
21 UnityFramework                 0x25e7510 selector_thread(void*) (.cold.1) + 4514559248
22 UnityFramework                 0x25c0650 selector_thread(void*) (.cold.1) + 4514399824
23 UnityFramework                 0x25b6eec selector_thread(void*) (.cold.1) + 4514361068
24 UnityFramework                 0x25c09c4 selector_thread(void*) (.cold.1) + 4514400708
25 UnityFramework                 0x25c07e4 selector_thread(void*) (.cold.1) + 4514400228
26 UnityFramework                 0x153c2f8 selector_thread(void*) (.cold.1) + 4497081080
27 UnityFramework                 0x152e3fc selector_thread(void*) (.cold.1) + 4497023996
28 UnityFramework                 0x152e0d4 selector_thread(void*) (.cold.1) + 4497023188
29 UnityFramework                 0x153c0b4 selector_thread(void*) (.cold.1) + 4497080500
30 UnityFramework                 0x153d1f8 selector_thread(void*) (.cold.1) + 4497084920
31 UnityFramework                 0x1541b74 selector_thread(void*) (.cold.1) + 4497103732
32 UnityFramework                 0x11308c RuntimeInvoker_TrueVoid_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5(void (*)(), MethodInfo const*, void*, void**) + 4475941004 (Il2CppInvokerTable.cpp:4475941004)
33 UnityFramework                 0x1306fcc il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**) + 564 (Runtime.cpp:564)
34 UnityFramework                 0xaa91f0 scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool) + 292 (ScriptingApi_Il2Cpp.cpp:292)
35 UnityFramework                 0xaad120 ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) + 273 (ScriptingInvocation.cpp:273)
36 UnityFramework                 0xac3c2c MonoBehaviour::CallUpdateMethod(int) + 534 (MonoBehaviour.cpp:534)
37 UnityFramework                 0x8f5b04 void BaseBehaviourManager::CommonUpdate<FixedBehaviourManager>() + 195 (Behaviour.cpp:195)
38 UnityFramework                 0x9cf3f0 ExecutePlayerLoop(NativePlayerLoopSystem*) + 383 (PlayerLoop.cpp:383)
39 UnityFramework                 0x9cf430 ExecutePlayerLoop(NativePlayerLoopSystem*) + 407 (PlayerLoop.cpp:407)
40 UnityFramework                 0x9cf6fc PlayerLoop() + 514 (PlayerLoop.cpp:514)
41 UnityFramework                 0xe2f918 UnityPlayerLoopImpl(bool) + 328 (LibEntryPoint.mm:328)
42 UnityFramework                 0x169f0 -[UnityAppController(Rendering) repaint] + 233 (UnityAppController+Rendering.mm:233)
43 UnityFramework                 0x16980 -[UnityAppController(Rendering) repaintDisplayLink] + 72 (UnityAppController+Rendering.mm:72)
44 QuartzCore                     0x28ca4 CA::smile:isplay::smile:isplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 820
45 QuartzCore                     0x156144 CA::smile:isplay::smile:isplayLink::dispatch_deferred_display_links(unsigned int) + 380
46 UIKitCore                      0x6525b0 _UIUpdateSequenceRun + 84
47 UIKitCore                      0xca1310 schedulerStepScheduledMainSection + 172
48 UIKitCore                      0xca04dc runloopSourceCallback + 92
49 CoreFoundation                 0xd5f24 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
50 CoreFoundation                 0xe22fc __CFRunLoopDoSource0 + 176
51 CoreFoundation                 0x66220 __CFRunLoopDoSources0 + 340
52 CoreFoundation                 0x7bb7c __CFRunLoopRun + 836
53 CoreFoundation                 0x80eb0 CFRunLoopRunSpecific + 612
54 GraphicsServices               0x1368 GSEventRunModal + 164
55 UIKitCore                      0x3a1668 -[UIApplication _run] + 888
56 UIKitCore                      0x3a12cc UIApplicationMain + 340
57 UnityFramework                 0x16524 -[UnityFramework runUIApplicationMainWithArgc:argv:] + 96 (main.mm:96)
58 CommandCenterEarth             0x7ccc main + 28 (main.mm:28)
59 ???                            0x1ec66c960 (Missing)

Thread
0  libsystem_kernel.dylib         0x12b0 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0xe44 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0xb98 start_wqthread + 8

Thread
0  libsystem_pthread.dylib        0xb90 start_wqthread + 254

com.apple.uikit.eventfetch-thread
0  libsystem_kernel.dylib         0xda8 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x13a1c mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x13c5c mach_msg_overwrite + 388
3  libsystem_kernel.dylib         0x12ec mach_msg + 24
4  CoreFoundation                 0x7aac4 __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x7bd08 __CFRunLoopRun + 1232
6  CoreFoundation                 0x80eb0 CFRunLoopRunSpecific + 612
7  Foundation                     0x42054 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
8  Foundation                     0x41f3c -[NSRunLoop(NSRunLoop) runUntilDate:] + 64
9  UIKitCore                      0x4d66a4 -[UIEventFetcher threadMain] + 436
10 Foundation                     0x5b518 __NSThread__start__ + 716
11 libsystem_pthread.dylib        0x16cc _pthread_start + 148
12 libsystem_pthread.dylib        0xba4 thread_start + 8

GC Finalizer
0  libsystem_kernel.dylib         0x167c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x806c _pthread_cond_wait + 1232
2  UnityFramework                 0x12cedfc il2cpp::os::posix::PosixWaitObject::Wait(unsigned int, bool) + 120 (PosixWaitObject.cpp:120)
3  UnityFramework                 0x12a1bf0 il2cpp::gc::FinalizerThread(void*) + 438 (BoehmGC.cpp:438)
4  UnityFramework                 0x12c5d30 il2cpp::os::Thread::RunWrapper(void*) + 183 (Thread.cpp:183)
5  UnityFramework                 0x12c7fe0 il2cpp::os::ThreadImpl::ThreadStartWrapper(void*) + 127 (ThreadImpl.cpp:127)
6  libsystem_pthread.dylib        0x16cc _pthread_start + 148
7  libsystem_pthread.dylib        0xba4 thread_start + 8

Job.Worker 0
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b0708 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 33 (Baselib_CappedSemaphore_SemaphoreBased.inl.h:33)
5  UnityFramework                 0x9af920 JobQueue::WorkLoop(void*) + 1103 (JobQueue.cpp:1103)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Job.Worker 1
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b0708 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 33 (Baselib_CappedSemaphore_SemaphoreBased.inl.h:33)
5  UnityFramework                 0x9af920 JobQueue::WorkLoop(void*) + 1103 (JobQueue.cpp:1103)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Job.Worker 2
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b0708 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 33 (Baselib_CappedSemaphore_SemaphoreBased.inl.h:33)
5  UnityFramework                 0x9af920 JobQueue::WorkLoop(void*) + 1103 (JobQueue.cpp:1103)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Job.Worker 3
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b0708 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 33 (Baselib_CappedSemaphore_SemaphoreBased.inl.h:33)
5  UnityFramework                 0x9af920 JobQueue::WorkLoop(void*) + 1103 (JobQueue.cpp:1103)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Job.Worker 4
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b0708 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 33 (Baselib_CappedSemaphore_SemaphoreBased.inl.h:33)
5  UnityFramework                 0x9af920 JobQueue::WorkLoop(void*) + 1103 (JobQueue.cpp:1103)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Background Job.Worker 0
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b0708 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 33 (Baselib_CappedSemaphore_SemaphoreBased.inl.h:33)
5  UnityFramework                 0x9af920 JobQueue::WorkLoop(void*) + 1103 (JobQueue.cpp:1103)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Background Job.Worker 1
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b0708 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 33 (Baselib_CappedSemaphore_SemaphoreBased.inl.h:33)
5  UnityFramework                 0x9af920 JobQueue::WorkLoop(void*) + 1103 (JobQueue.cpp:1103)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Background Job.Worker 2
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b0708 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 33 (Baselib_CappedSemaphore_SemaphoreBased.inl.h:33)
5  UnityFramework                 0x9af920 JobQueue::WorkLoop(void*) + 1103 (JobQueue.cpp:1103)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Background Job.Worker 3
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b0708 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 33 (Baselib_CappedSemaphore_SemaphoreBased.inl.h:33)
5  UnityFramework                 0x9af920 JobQueue::WorkLoop(void*) + 1103 (JobQueue.cpp:1103)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Background Job.Worker 4
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b0708 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 33 (Baselib_CappedSemaphore_SemaphoreBased.inl.h:33)
5  UnityFramework                 0x9af920 JobQueue::WorkLoop(void*) + 1103 (JobQueue.cpp:1103)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Background Job.Worker 5
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b0708 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 33 (Baselib_CappedSemaphore_SemaphoreBased.inl.h:33)
5  UnityFramework                 0x9af920 JobQueue::WorkLoop(void*) + 1103 (JobQueue.cpp:1103)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Background Job.Worker 6
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b0708 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 33 (Baselib_CappedSemaphore_SemaphoreBased.inl.h:33)
5  UnityFramework                 0x9af920 JobQueue::WorkLoop(void*) + 1103 (JobQueue.cpp:1103)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Background Job.Worker 7
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b0708 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 33 (Baselib_CappedSemaphore_SemaphoreBased.inl.h:33)
5  UnityFramework                 0x9af920 JobQueue::WorkLoop(void*) + 1103 (JobQueue.cpp:1103)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Background Job.Worker 8
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b0708 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 33 (Baselib_CappedSemaphore_SemaphoreBased.inl.h:33)
5  UnityFramework                 0x9af920 JobQueue::WorkLoop(void*) + 1103 (JobQueue.cpp:1103)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Background Job.Worker 9
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b0708 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 33 (Baselib_CappedSemaphore_SemaphoreBased.inl.h:33)
5  UnityFramework                 0x9af920 JobQueue::WorkLoop(void*) + 1103 (JobQueue.cpp:1103)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Background Job.Worker 10
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b0708 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 33 (Baselib_CappedSemaphore_SemaphoreBased.inl.h:33)
5  UnityFramework                 0x9af920 JobQueue::WorkLoop(void*) + 1103 (JobQueue.cpp:1103)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Background Job.Worker 11
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b0708 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 33 (Baselib_CappedSemaphore_SemaphoreBased.inl.h:33)
5  UnityFramework                 0x9af920 JobQueue::WorkLoop(void*) + 1103 (JobQueue.cpp:1103)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Background Job.Worker 12
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b0708 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 33 (Baselib_CappedSemaphore_SemaphoreBased.inl.h:33)
5  UnityFramework                 0x9af920 JobQueue::WorkLoop(void*) + 1103 (JobQueue.cpp:1103)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Background Job.Worker 13
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b0708 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 33 (Baselib_CappedSemaphore_SemaphoreBased.inl.h:33)
5  UnityFramework                 0x9af920 JobQueue::WorkLoop(void*) + 1103 (JobQueue.cpp:1103)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Background Job.Worker 14
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b0708 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 33 (Baselib_CappedSemaphore_SemaphoreBased.inl.h:33)
5  UnityFramework                 0x9af920 JobQueue::WorkLoop(void*) + 1103 (JobQueue.cpp:1103)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Background Job.Worker 15
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b0708 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 33 (Baselib_CappedSemaphore_SemaphoreBased.inl.h:33)
5  UnityFramework                 0x9af920 JobQueue::WorkLoop(void*) + 1103 (JobQueue.cpp:1103)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

BatchDeleteObjects
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0xa526d0 ThreadedStreamBuffer::HandleOutOfBufferToReadFrom(ThreadedStreamBuffer::smile:ataOffsets) + 41 (Baselib_Semaphore_SemaphoreBased.inl.h:41)
5  UnityFramework                 0x9cd80c BatchDeleteStep2Threaded(void*) + 93 (BatchDeleteObjects.cpp:93)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Loading.AsyncRead
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x8f146c AsyncReadManagerThreaded::ThreadEntry() + 41 (Baselib_Semaphore_SemaphoreBased.inl.h:41)
5  UnityFramework                 0x8f0fc4 AsyncReadManagerThreaded::StaticThreadEntry(void*) + 120 (AsyncReadManagerThreaded.cpp:120)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Thread
0  libsystem_pthread.dylib        0xb90 start_wqthread + 254

Crashed: UnityGfxDeviceWorker
0  UnityFramework                 0x6d600c ParticleSystemParticles::CopyToArrayAOS(ParticleSystemParticle*, int, int) const + 427 (ParticleSystemParticle.cpp:427)
1  UnityFramework                 0xcd1b8c ParticleSystemTrailGeometryJob::ConfigurePerParticleTrailParams(ParticleLineParameters&, ParticleSystemParticles const*, unsigned long, ParticleSystemTrailGeometryJob const&, float) + 3269 (ParticleSystemGeometryJob.cpp:3269)
2  UnityFramework                 0xcd07a0 ParticleSystemTrailGeometryJob::RenderJobCommon(ParticleSystemTrailGeometryJob&, void*, unsigned int) + 3105 (ParticleSystemGeometryJob.cpp:3105)
3  UnityFramework                 0xccfb70 ParticleSystemTrailGeometryJob::RenderJob(SharedGeometryJobData*, unsigned int) + 2991 (ParticleSystemGeometryJob.cpp:2991)
4  UnityFramework                 0x9aff84 JobQueue::Exec(JobInfo*, long long, int, bool) + 621 (JobQueue.cpp:621)
5  UnityFramework                 0x9b0250 JobQueue::Steal(JobGroup*, JobInfo*, long long, int, bool, bool) + 736 (JobQueue.cpp:736)
6  UnityFramework                 0x9b13b4 JobQueue::WaitForJobGroupID(JobGroupID, JobQueue::JobQueueWorkStealMode) + 1758 (JobQueue.cpp:1758)
7  UnityFramework                 0x9aee74 CompleteFenceInternal(JobFence&, WorkStealMode) + 17 (Jobs.cpp:17)
8  UnityFramework                 0xa79354 GeometryJobTasks::PutGeometryJobFence(GfxDevice&, GeometryJobFence) + 282 (Jobs.h:282)
9  UnityFramework                 0xa90254 GfxDevice::PutGeometryJobFence(GeometryJobFence&) + 76 (GeometryJob.h:76)
10 UnityFramework                 0xa902d0 GfxDevice::smile:rawSharedGeometryJobs(DynamicVBOBuffer const&, unsigned int, DynamicVBOBuffer const&, unsigned int, GeometryJobFence, DrawBuffersRange const*, unsigned long, VertexDeclaration*) + 876 (GfxDevice.cpp:876)
11 UnityFramework                 0xd8ba18 GfxDeviceWorker::RunCommand(ThreadedStreamBuffer&) + 776 (GfxDeviceWorker.cpp:776)
12 UnityFramework                 0xdfaad4 GfxDeviceWorkerAutoreleasePoolProxy + 5330 (GfxDeviceMetal.mm:5330)
13 UnityFramework                 0xd90908 GfxDeviceWorker::RunExt(ThreadedStreamBuffer&) + 389 (GfxDeviceWorker.cpp:389)
14 UnityFramework                 0xd8866c GfxDeviceWorker::RunGfxDeviceWorker(void*) + 353 (GfxDeviceWorker.cpp:353)
15 UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
16 libsystem_pthread.dylib        0x16cc _pthread_start + 148
17 libsystem_pthread.dylib        0xba4 thread_start + 8

Thread
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  UnityFramework                 0x123ab10 FMOD_OS_Semaphore_Wait(FMOD_OS_SEMAPHORE*) + 3399812
2  UnityFramework                 0x12571c8 FMOD::Thread::callback(void*) + 3516220
3  libsystem_pthread.dylib        0x16cc _pthread_start + 148
4  libsystem_pthread.dylib        0xba4 thread_start + 8

AURemoteIO::IOThread
0  libsystem_kernel.dylib         0xda8 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x13a1c mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x13c5c mach_msg_overwrite + 388
3  libsystem_kernel.dylib         0x12ec mach_msg + 24
4  libEmbeddedSystemAUs.dylib     0xa824c void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, AURemoteIO::IOThread::IOThread(AURemoteIO&, caulk::thread::attributes const&, caulk::mach::os_workgroup_managed const&)::'lambda'(), std::__1::tuple<> > >(void*) + 556
5  libsystem_pthread.dylib        0x16cc _pthread_start + 148
6  libsystem_pthread.dylib        0xba4 thread_start + 8

Thread
0  libsystem_kernel.dylib         0x1268 __semwait_signal + 8
1  libsystem_c.dylib              0x57d8 nanosleep + 220
2  libsystem_c.dylib              0x64a4 usleep + 68
3  UnityFramework                 0x123a6d8 FMOD_OS_Time_Sleep(unsigned int) + 3398732
4  UnityFramework                 0x1257234 FMOD::Thread::callback(void*) + 3516328
5  libsystem_pthread.dylib        0x16cc _pthread_start + 148
6  libsystem_pthread.dylib        0xba4 thread_start + 8

com.apple.CoreMotion.MotionThread
0  libsystem_kernel.dylib         0xda8 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x13a1c mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x13c5c mach_msg_overwrite + 388
3  libsystem_kernel.dylib         0x12ec mach_msg + 24
4  CoreFoundation                 0x7aac4 __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x7bd08 __CFRunLoopRun + 1232
6  CoreFoundation                 0x80eb0 CFRunLoopRunSpecific + 612
7  CoreFoundation                 0xc4cd4 CFRunLoopRun + 64
8  CoreMotion                     0x13ef8 CLMotionActivity::isTypeInVehicle(CLMotionActivity::Type) + 22908
9  libsystem_pthread.dylib        0x16cc _pthread_start + 148
10 libsystem_pthread.dylib        0xba4 thread_start + 8

Loading.PreloadManager
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9dd0dc PreloadManager::Run() + 41 (Baselib_Semaphore_SemaphoreBased.inl.h:41)
5  UnityFramework                 0x9dd028 PreloadManager::Run(void*) + 183 (PreloadManager.cpp:183)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

CloudJob.Worker 0
0  libsystem_kernel.dylib         0xd24 semaphore_wait_trap + 8
1  libdispatch.dylib              0x4524 _dispatch_sema4_wait + 28
2  libdispatch.dylib              0x4bd8 _dispatch_semaphore_wait_slow + 132
3  UnityFramework                 0xef5150 UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) + 36 (Baselib_SystemSemaphore_DarwinApi.inl.h:36)
4  UnityFramework                 0x9b0708 JobQueue::ProcessJobs(JobQueue::ThreadInfo*, void*) + 33 (Baselib_CappedSemaphore_SemaphoreBased.inl.h:33)
5  UnityFramework                 0x9af920 JobQueue::WorkLoop(void*) + 1103 (JobQueue.cpp:1103)
6  UnityFramework                 0xa510c0 Thread::RunThreadWrapper(void*) + 81 (Thread.cpp:81)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

com.google.firebase.crashlytics.MachExceptionServer
0  UnityFramework                 0x2c81d8 FIRCLSProcessRecordAllThreads + 393 (FIRCLSProcess.c:393)
1  UnityFramework                 0x2c85b8 FIRCLSProcessRecordAllThreads + 424 (FIRCLSProcess.c:424)
2  UnityFramework                 0x2bf8c8 FIRCLSHandler + 34 (FIRCLSHandler.m:34)
3  UnityFramework                 0x2c2018 FIRCLSMachExceptionServer + 521 (FIRCLSMachException.c:521)
4  libsystem_pthread.dylib        0x16cc _pthread_start + 148
5  libsystem_pthread.dylib        0xba4 thread_start + 8

com.apple.NSURLConnectionLoader
0  libsystem_kernel.dylib         0xda8 mach_msg2_trap + 8
1  libsystem_kernel.dylib         0x13a1c mach_msg2_internal + 80
2  libsystem_kernel.dylib         0x13c5c mach_msg_overwrite + 388
3  libsystem_kernel.dylib         0x12ec mach_msg + 24
4  CoreFoundation                 0x7aac4 __CFRunLoopServiceMachPort + 160
5  CoreFoundation                 0x7bd08 __CFRunLoopRun + 1232
6  CoreFoundation                 0x80eb0 CFRunLoopRunSpecific + 612
7  CFNetwork                      0x257ff0 _CFURLStorageSessionDisableCache + 61088
8  Foundation                     0x5b518 __NSThread__start__ + 716
9  libsystem_pthread.dylib        0x16cc _pthread_start + 148
10 libsystem_pthread.dylib        0xba4 thread_start + 8

JavaScriptCore libpas scavenger
0  libsystem_kernel.dylib         0x167c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x806c _pthread_cond_wait + 1232
2  JavaScriptCore                 0xf703c scavenger_thread_main + 1164
3  libsystem_pthread.dylib        0x16cc _pthread_start + 148
4  libsystem_pthread.dylib        0xba4 thread_start + 8

Thread
0  libsystem_kernel.dylib         0x167c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x8098 _pthread_cond_wait + 1276
2  UnityFramework                 0x12ced98 il2cpp::os::posix::PosixWaitObject::Wait(unsigned int, bool) + 153 (PosixWaitObject.cpp:153)
3  UnityFramework                 0x12c3e18 monitor_thread(void*) + 156 (ThreadPoolMonitorThread.cpp:156)
4  UnityFramework                 0x12f6770 il2cpp::vm::ThreadStart(void*) + 727 (Thread.cpp:727)
5  UnityFramework                 0x12c5d30 il2cpp::os::Thread::RunWrapper(void*) + 183 (Thread.cpp:183)
6  UnityFramework                 0x12c7fe0 il2cpp::os::ThreadImpl::ThreadStartWrapper(void*) + 127 (ThreadImpl.cpp:127)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

Timer-Scheduler
0  libsystem_kernel.dylib         0x167c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x806c _pthread_cond_wait + 1232
2  UnityFramework                 0x12cedfc il2cpp::os::posix::PosixWaitObject::Wait(unsigned int, bool) + 120 (PosixWaitObject.cpp:120)
3  UnityFramework                 0x12b9494 il2cpp::icalls::mscorlib::System::Threading::WaitHandle::Wait_internal(void**, int, bool, int) + 91 (WaitHandle.cpp:91)
4  UnityFramework                 0x3284234 selector_thread(void*) (.cold.1) + 4527784500
5  UnityFramework                 0x3284100 selector_thread(void*) (.cold.1) + 4527784192
6  UnityFramework                 0x32b9394 selector_thread(void*) (.cold.1) + 4528001940
7  UnityFramework                 0x3223c6c selector_thread(void*) (.cold.1) + 4527389804
8  UnityFramework                 0x3269af4 selector_thread(void*) (.cold.1) + 4527676148
9  UnityFramework                 0x3323434 selector_thread(void*) (.cold.1) + 4528436276
10 UnityFramework                 0x3223c6c selector_thread(void*) (.cold.1) + 4527389804
11 UnityFramework                 0x11308c RuntimeInvoker_TrueVoid_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5(void (*)(), MethodInfo const*, void*, void**) + 4475941004 (Il2CppInvokerTable.cpp:4475941004)
12 UnityFramework                 0x1306fcc il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**) + 564 (Runtime.cpp:564)
13 UnityFramework                 0x12b8ee8 il2cpp::icalls::mscorlib::System::Threading::ThreadStart(void*) + 158 (Thread.cpp:158)
14 UnityFramework                 0x12c5d30 il2cpp::os::Thread::RunWrapper(void*) + 183 (Thread.cpp:183)
15 UnityFramework                 0x12c7fe0 il2cpp::os::ThreadImpl::ThreadStartWrapper(void*) + 127 (ThreadImpl.cpp:127)
16 libsystem_pthread.dylib        0x16cc _pthread_start + 148
17 libsystem_pthread.dylib        0xba4 thread_start + 8

Thread
0  libsystem_kernel.dylib         0x12b0 __workq_kernreturn + 8
1  libsystem_pthread.dylib        0xe44 _pthread_wqthread + 364
2  libsystem_pthread.dylib        0xb98 start_wqthread + 8

IL2CPP Threadpool worker
0  libsystem_kernel.dylib         0x167c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x806c _pthread_cond_wait + 1232
2  UnityFramework                 0x12cdf14 il2cpp::os::ConditionVariableImpl::TimedWait(il2cpp::os::FastMutexImpl*, unsigned int) + 51 (ConditionVariableImpl.cpp:51)
3  UnityFramework                 0x12c46b0 worker_thread(void*) + 87 (ThreadPoolWorkerThread.cpp:87)
4  UnityFramework                 0x12f6770 il2cpp::vm::ThreadStart(void*) + 727 (Thread.cpp:727)
5  UnityFramework                 0x12c5d30 il2cpp::os::Thread::RunWrapper(void*) + 183 (Thread.cpp:183)
6  UnityFramework                 0x12c7fe0 il2cpp::os::ThreadImpl::ThreadStartWrapper(void*) + 127 (ThreadImpl.cpp:127)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

IL2CPP Threadpool worker
0  libsystem_kernel.dylib         0x167c __psynch_cvwait + 8
1  libsystem_pthread.dylib        0x806c _pthread_cond_wait + 1232
2  UnityFramework                 0x12cdf14 il2cpp::os::ConditionVariableImpl::TimedWait(il2cpp::os::FastMutexImpl*, unsigned int) + 51 (ConditionVariableImpl.cpp:51)
3  UnityFramework                 0x12c46b0 worker_thread(void*) + 87 (ThreadPoolWorkerThread.cpp:87)
4  UnityFramework                 0x12f6770 il2cpp::vm::ThreadStart(void*) + 727 (Thread.cpp:727)
5  UnityFramework                 0x12c5d30 il2cpp::os::Thread::RunWrapper(void*) + 183 (Thread.cpp:183)
6  UnityFramework                 0x12c7fe0 il2cpp::os::ThreadImpl::ThreadStartWrapper(void*) + 127 (ThreadImpl.cpp:127)
7  libsystem_pthread.dylib        0x16cc _pthread_start + 148
8  libsystem_pthread.dylib        0xba4 thread_start + 8

As you can see the UnityGfxDeviceWorker crashes when copying the particle system.

This is a really big issue for me and would really appreciate someone form Unity chiming in.

Thanks in advance!

Hi,
I encountered a similar issue about ParticleSystem before: Unity 2022.2.1f1 iOS Build crash (possibly with ParticleSystemGeometryJob?) .

Based on the callstack of crash and your code, I created a minimal project to reproduce the issue using Unity 2020.3.47.

Here is the code (Full project is in the attachment below):

public class Test : MonoBehaviour
{
    public GameObject Prefab;
    public int MaxCount;
    public int BatchSize;
    public int[] RandomFrameRange;

    private void Start()
    {
        Application.runInBackground = true;

        for (int i = 0; i < MaxCount / BatchSize; ++i)
            StartCoroutine(Execute(BatchSize));
    }

    private IEnumerator Execute(int batchSize)
    {
        var pss = new List<ParticleSystem>(batchSize);

        while (true)
        {
            for (int i = 0; i < batchSize; ++i)
            {
                var go = Instantiate(Prefab);
                var ps = go.GetComponent<ParticleSystem>();
                pss.Add(ps);
            }

            int frames = Random.Range(RandomFrameRange[0], RandomFrameRange[1]);
            while (frames-- > 0)
                yield return null;

            for (int i = 0; i < batchSize; ++i)
            {
                var particles = new ParticleSystem.Particle[pss[i].particleCount];
                pss[i].GetParticles(particles);
            }

            frames = 5;
            while (frames-- > 0)
                yield return null;

            for (int i = 0; i < batchSize; ++i)
            {
                Destroy(pss[i]);
            }

            pss.Clear();

            yield return null;
        }
    }
}

The project can reproduce the issue in minutes on the following devices:

  • Mi 10
  • Redmi 8A
  • iPhone 6s

I think it’s an issue about race condition: some data is being created when ParticleSystem.GetParticles is called, and at the same time, ParticleSystemParticles::CopyToArrayAOS tries to use that data.

The project has been submitted to Unity: IN-40907.

9009394–1241863–ParticleSystemCrash.zip (29.4 KB)

As a workaround, you can try to use ParticleSystem.Simulate before calling ParticleSystem.GetParticles. ParticleSystem.Simulate will sync with render job internally, so it should avoid ParticleSystem.GetParticles and render job from running simultaneously:

for (int i = 0; i < batchSize; ++i)
{
    var particles = new ParticleSystem.Particle[pss[i].particleCount];
    pss[i].Simulate(0, true, false);  // <----
    pss[i].GetParticles(particles);
}

IssueTracker link: Unity Issue Tracker - [Android] The Player crashes after a few seconds when Particles are generated and deleted continuously over time