Crash on startup with DOTS 1.3.5 on phones with ARM Cortex-A53 and ARM Cortex-A55 CPUs

Hello, I have a game currently in production, and it is experiencing a significantly high crash rate. The game works perfectly fine on both of my test devices and in the Unity editor. I’ve tested it extensively, running for 6 hours on each device without any issues. However, it seems to crash on certain types of phones, with some users reporting that it crashes at startup, even before the game begins.

[Update] The issue occurs during the loading stage of the subscenes, and strangely, it happens repeatedly on specific types of devices (with ARM Cortex-A53 and ARM Cortex-A55 CPUs). Players complain that as soon as they open the game, it kicks them out

Google Play also shows these two notes :

Below are the error reports displayed on Google Play:

-1

[libil2cpp.so] UnsafeMatchingArchetypePtrList_Add_m43B6BBDC6F571762C3D6DCDCAE5BBCF7E7332305

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 10551 >>> com.TrinityGames.AntSim <<<

backtrace:
  #00  pc 0x00000000043e23b0  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libil2cpp.so (UnsafeMatchingArchetypePtrList_Add_m43B6BBDC6F571762C3D6DCDCAE5BBCF7E7332305) (BuildId: cbd9eb60351ad591a33537caec8f8976ed06f9a9)
  #01  pc 0x00000000043e1b54  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libil2cpp.so (EntityQueryManager_AddArchetypeIfMatching_m103005CB73DADB036C9C0A35FE24B8654616BE02) (BuildId: cbd9eb60351ad591a33537caec8f8976ed06f9a9)
  #02  pc 0x00000000043e2098  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libil2cpp.so (EntityQueryManager_AddAdditionalArchetypes_mBFF2F57CB30D354F7C7640F0DC6B06798086495D) (BuildId: cbd9eb60351ad591a33537caec8f8976ed06f9a9)
  #03  pc 0x000000000437d7b0  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libil2cpp.so (EntityComponentStore_EndArchetypeChangeTracking_m7E79B4A694CC7243C9D1AAD12A5BE01F14746B26) (BuildId: cbd9eb60351ad591a33537caec8f8976ed06f9a9)
  #04  pc 0x00000000043a8c98  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libil2cpp.so (EntityDataAccess_EndStructuralChanges_m1559113653255CED98A6467150D85D6DAF3DE438) (BuildId: cbd9eb60351ad591a33537caec8f8976ed06f9a9)
  #05  pc 0x00000000043b63f8  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libil2cpp.so (EntityManager_MoveEntitiesFromInternalAll_mFD7931820464C08F4C509F47240C314130E6D1BD) (BuildId: cbd9eb60351ad591a33537caec8f8976ed06f9a9)
  #06  pc 0x00000000043b6a6c  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libil2cpp.so (EntityManager_MoveEntitiesFrom_m4C25D29744254204AC07EC0E790873F0A90A7380) (BuildId: cbd9eb60351ad591a33537caec8f8976ed06f9a9)
  #07  pc 0x00000000048c562c  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libil2cpp.so (SceneSectionStreamingSystem_MoveEntities_m9436CB60CFA2FCAAD8FBD622A8BFDCA70E34A5FB) (BuildId: cbd9eb60351ad591a33537caec8f8976ed06f9a9)
  #08  pc 0x00000000048c66a8  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libil2cpp.so (SceneSectionStreamingSystem_UpdateLoadOperation_mC3CC60795D148C4D5B4DBC1BAB083B129ABECEE7) (BuildId: cbd9eb60351ad591a33537caec8f8976ed06f9a9)
  #09  pc 0x00000000048c619c  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libil2cpp.so (SceneSectionStreamingSystem_ProcessActiveStreams_mE7326AB99FF0AC55EDB08634A5B9449DA849E7FE) (BuildId: cbd9eb60351ad591a33537caec8f8976ed06f9a9)
  #10  pc 0x00000000048c835c  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libil2cpp.so (SceneSectionStreamingSystem_OnUpdate_m48E550F61E3B9720FA4CBC7B99BE33FD55750A85) (BuildId: cbd9eb60351ad591a33537caec8f8976ed06f9a9)
  #11  pc 0x00000000043fc5c4  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libil2cpp.so (SystemBase_Update_m795994EE60C054DFA78C313A60ED025B2668C9B4) (BuildId: cbd9eb60351ad591a33537caec8f8976ed06f9a9)
  #12  pc 0x00000000042e57a0  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libil2cpp.so (ComponentSystemGroup_UpdateAllSystems_m78B1AA9EAF07133497E9BA556B592AC93935441C) (BuildId: cbd9eb60351ad591a33537caec8f8976ed06f9a9)
  #13  pc 0x00000000043fc5c4  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libil2cpp.so (SystemBase_Update_m795994EE60C054DFA78C313A60ED025B2668C9B4) (BuildId: cbd9eb60351ad591a33537caec8f8976ed06f9a9)
  #14  pc 0x00000000042e57a0  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libil2cpp.so (ComponentSystemGroup_UpdateAllSystems_m78B1AA9EAF07133497E9BA556B592AC93935441C) (BuildId: cbd9eb60351ad591a33537caec8f8976ed06f9a9)
  #15  pc 0x00000000043fc5c4  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libil2cpp.so (SystemBase_Update_m795994EE60C054DFA78C313A60ED025B2668C9B4) (BuildId: cbd9eb60351ad591a33537caec8f8976ed06f9a9)
  #16  pc 0x0000000001557770  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libil2cpp.so (il2cpp::vm::Runtime::InvokeWithThrow(MethodInfo const*, void*, void**)) (BuildId: cbd9eb60351ad591a33537caec8f8976ed06f9a9)
  #17  pc 0x00000000015576b0  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libil2cpp.so (il2cpp::vm::Runtime::Invoke(MethodInfo const*, void*, void**, Il2CppException**)) (BuildId: cbd9eb60351ad591a33537caec8f8976ed06f9a9)
  #18  pc 0x00000000003d3f71  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libunity.so (scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool)) (BuildId: db7c33d92497fa3d)
  #19  pc 0x00000000003e244f  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libunity.so (ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool)) (BuildId: db7c33d92497fa3d)
  #20  pc 0x0000000000317f15  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libunity.so (ExecutePlayerLoop(NativePlayerLoopSystem*)) (BuildId: db7c33d92497fa3d)
  #21  pc 0x0000000000317eeb  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libunity.so (ExecutePlayerLoop(NativePlayerLoopSystem*)) (BuildId: db7c33d92497fa3d)
  #22  pc 0x00000000003180e3  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libunity.so (PlayerLoop()) (BuildId: db7c33d92497fa3d)
  #23  pc 0x0000000000450291  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libunity.so (UnityPlayerLoop()) (BuildId: db7c33d92497fa3d)
  #24  pc 0x000000000000cc4b  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libgame.so (Unity::UnityApplication::ProcessFrame()+38) (BuildId: 6840ab80f58525e7836975e6bdc92e9826b09d32)
  #25  pc 0x000000000000cde9  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libgame.so (Unity::UnityApplication::Loop()+312) (BuildId: 6840ab80f58525e7836975e6bdc92e9826b09d32)
  #26  pc 0x000000000000ed37  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libgame.so (MainLoop(android_app*)+38) (BuildId: 6840ab80f58525e7836975e6bdc92e9826b09d32)
  #27  pc 0x000000000000edd3  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libgame.so (android_main+102) (BuildId: 6840ab80f58525e7836975e6bdc92e9826b09d32)
  #28  pc 0x0000000000013e71  /data/app/~~CCXGNuvwHeyaz6NVfeOyDQ==/com.TrinityGames.AntSim-0TtnZibtefRFxxCbn8Zb3Q==/lib/arm/libgame.so (android_app_entry) (BuildId: 6840ab80f58525e7836975e6bdc92e9826b09d32)
  #29  pc 0x00000000000ad03f  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+40)
  #30  pc 0x0000000000063b33  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+30)

In my code, I use specific patterns to avoid structural changes, such as employing EndSimulationEntityCommandBuffer to enable and disable components rather than destroying entities. For example, I manage logins and logouts by enabling components that mark an entity as “dead” or “live” within a system, preventing structural changes. I do not use EntityGraphics at all.

However, in some systems, I use the following constructs:

* `state.GetComponentTypeHandle`
* `state.RequireForUpdate`
* `state.RequireAnyForUpdate`
* `ComponentTypeHandle`
* `EntityTypeHandle`
* `var builder = new EntityQueryBuilder(Allocator.Temp)`
* `.ToArchetypeChunkArray(Allocator.TempJob)`
* `chunk.GetNativeArray()`
* `chunk.GetNativeArray(entityChunkType)`

Additionally, I make use of the following system attributes:

[UpdateInGroup(typeof(PhysicsSystemGroup))]
[UpdateAfter(typeof(PhysicsInitializeGroup))]
[UpdateBefore(typeof(PhysicsSimulationGroup))]

I also utilize ComponentLookup<NegativeMeshColliderTagCo> like this:

ComponentLookup<NegativeMeshColliderTagCo> negativeMeshColliderTagFE = SystemAPI.GetComponentLookup<NegativeMeshColliderTagCo>(true);

In relation to physics, I reference the PhysicsWorldSingleton:

physicsWorldSystem = SystemAPI.GetSingleton<PhysicsWorldSingleton>();
CollisionWorld collisionWorld = physicsWorldSystem.PhysicsWorld.CollisionWorld;

Let me know if you need any further information.