Hey everyone,
I’m currently trying to track down a crash somewhere around Unity.Entities.EntityComponentStore.InstantiateEntitiesOne
:
12-19 15:18:35.795 18961 19054 E AndroidRuntime: FATAL EXCEPTION: UnityMain
12-19 15:18:35.795 18961 19054 E AndroidRuntime: Process: com.legioncommander, PID: 18961
12-19 15:18:35.795 18961 19054 E AndroidRuntime: java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
12-19 15:18:35.795 18961 19054 E AndroidRuntime: Version '2020.1.17f1 (9957aee8edc2)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
12-19 15:18:35.795 18961 19054 E AndroidRuntime: Build fingerprint: 'google/coral/coral:11/RQ1A.201205.008/6943376:user/release-keys'
12-19 15:18:35.795 18961 19054 E AndroidRuntime: Revision: 'MP1.0'
12-19 15:18:35.795 18961 19054 E AndroidRuntime: ABI: 'arm64'
12-19 15:18:35.795 18961 19054 E AndroidRuntime: Timestamp: 2020-12-19 15:18:35-0800
12-19 15:18:35.795 18961 19054 E AndroidRuntime: pid: 18961, tid: 19054, name: UnityMain >>> com.legioncommander <<<
12-19 15:18:35.795 18961 19054 E AndroidRuntime: uid: 10512
12-19 15:18:35.795 18961 19054 E AndroidRuntime: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
12-19 15:18:35.795 18961 19054 E AndroidRuntime: Cause: null pointer dereference
12-19 15:18:35.795 18961 19054 E AndroidRuntime: x0 00000076c12d5c50 x1 0000000000001209 x2 0000000000000001 x3 00000077701cb190
12-19 15:18:35.795 18961 19054 E AndroidRuntime: x4 0000000000000001 x5 0000000000000000 x6 0000000000000000 x7 0000000000000001
12-19 15:18:35.795 18961 19054 E AndroidRuntime: x8 00000077701caa61 x9 0000000000012090 x10 00000077c8dad2dc x11 0000000000000000
12-19 15:18:35.795 18961 19054 E AndroidRuntime: x12 0000000000000050 x13 0000000000000000 x14 00000076700594c0 x15 0000000000000000
12-19 15:18:35.795 18961 19054 E AndroidRuntime: x16 000000774c121970 x17 0000007a6dcbc520 x18 0000000000000032 x19 0000000000000001
12-19 15:18:35.795 18961 19054 E AndroidRuntime: x20 00000076c12d5c50 x21 000000770011d5b8 x22 00000077701cafd8 x23 0000007670059440
12-19 15:18:35.795 18961 19054 E AndroidRuntime: x24 0000000000000000 x25 00000077701cac90 x26 000000770011d5b8 x27 0000000000000001
12-19 15:18:35.795 18961 19054 E AndroidRuntime: x28 00000076700594c8 x29 00000077701caf20
12-19 15:18:35.795 18961 19054 E AndroidRuntime: sp 00000077701caa60 lr 00000077c8dae330 pc 00000077c8db15d8
12-19 15:18:35.795 18961 19054 E AndroidRuntime:
12-19 15:18:35.795 18961 19054 E AndroidRuntime: backtrace:
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #00 pc 00000000000635d8 /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/lib/arm64/lib_burst_generated.so (Unity.Entities.EntityComponentStore.InstantiateEntitiesOne(Unity.Entities.EntityComponentStore* this, Unity.Entities.Entity srcEntity, Unity.Entities.Entity* outputEntities, int instanceCount, Unity.Entities.EntityComponentStore.InstantiateRemapChunk* remapChunks, int remapChunksCount, bool removePrefab)_AB9C1270D2EF1866+84) (BuildId: f3ecc0df421e1a0d5a97b0db1b4090564ec08f22)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #01 pc 000000000006032c /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/lib/arm64/lib_burst_generated.so (Unity.Entities.EntityCommandBuffer.PlaybackUnmanagedCommandInternal(Unity.Entities.EntityDataAccess* mgr, Unity.Entities.BasicCommand* header, ref Unity.Entities.ECBSharedPlaybackState playbackState, Unity.Entities.PlaybackPolicy playbackPolicy, Unity.Collections.LowLevel.Unsafe.UnsafeList* managedReferenceIndexRemovalCount, ref Unity.Entities.EntityComponentStore.ArchetypeChanges archetypeChanges)_5F1A00C44E31E45B+4444) (BuildId: f3ecc0df421e1a0d5a97b0db1b4090564ec08f22)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #02 pc 000000000005f0e0 /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/lib/arm64/lib_burst_generated.so (34146f210f5f72cb3338fe0fb7212d4f+176) (BuildId: f3ecc0df421e1a0d5a97b0db1b4090564ec08f22)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #03 pc 0000000000cec9cc /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/lib/arm64/libil2cpp.so (BuildId: ef0375dda0b16c90265aa9d92caa5322bca9baee)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #04 pc 00000000012b07f0 /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/lib/arm64/libil2cpp.so (BuildId: ef0375dda0b16c90265aa9d92caa5322bca9baee)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #05 pc 000000000188dde4 /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/lib/arm64/libil2cpp.so (BuildId: ef0375dda0b16c90265aa9d92caa5322bca9baee)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #06 pc 000000000188b880 /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/lib/arm64/libil2cpp.so (BuildId: ef0375dda0b16c90265aa9d92caa5322bca9baee)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #07 pc 00000000018450e0 /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/lib/arm64/libil2cpp.so (BuildId: ef0375dda0b16c90265aa9d92caa5322bca9baee)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #08 pc 0000000001845168 /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/lib/arm64/libil2cpp.so (BuildId: ef0375dda0b16c90265aa9d92caa5322bca9baee)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #09 pc 0000000001880f10 /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/lib/arm64/libil2cpp.so (BuildId: ef0375dda0b16c90265aa9d92caa5322bca9baee)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #10 pc 0000000001883df4 /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/lib/arm64/libil2cpp.so (BuildId: ef0375dda0b16c90265aa9d92caa5322bca9baee)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #11 pc 0000000001880f10 /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/lib/arm64/libil2cpp.so (BuildId: ef0375dda0b16c90265aa9d92caa5322bca9baee)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #12 pc 0000000001c0e660 /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/lib/arm64/libil2cpp.so (BuildId: ef0375dda0b16c90265aa9d92caa5322bca9baee)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #13 pc 0000000000a3d13c /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/lib/arm64/libil2cpp.so (BuildId: ef0375dda0b16c90265aa9d92caa5322bca9baee)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #14 pc 0000000000dbc054 /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/lib/arm64/libil2cpp.so (BuildId: ef0375dda0b16c90265aa9d92caa5322bca9baee)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #15 pc 0000000000353850 /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/lib/arm64/libunity.so (BuildId: 3c4a2749beb7174f6ec8e8efdd79ac10764dfd1b)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #16 pc 000000000036026c /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/lib/arm64/libunity.so (BuildId: 3c4a2749beb7174f6ec8e8efdd79ac10764dfd1b)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #17 pc 00000000002a26b8 /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/lib/arm64/libunity.so (BuildId: 3c4a2749beb7174f6ec8e8efdd79ac10764dfd1b)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #18 pc 00000000002a266c /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/lib/arm64/libunity.so (BuildId: 3c4a2749beb7174f6ec8e8efdd79ac10764dfd1b)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #19 pc 00000000002a28b0 /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/lib/arm64/libunity.so (BuildId: 3c4a2749beb7174f6ec8e8efdd79ac10764dfd1b)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #20 pc 00000000003c7750 /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/lib/arm64/libunity.so (BuildId: 3c4a2749beb7174f6ec8e8efdd79ac10764dfd1b)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #21 pc 00000000003dacf0 /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/lib/arm64/libunity.so (BuildId: 3c4a2749beb7174f6ec8e8efdd79ac10764dfd1b)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: #22 pc 00000000000456cc /data/app/~~cubMY7_yxqDSxiBJARh4gQ==/com.legioncommander-Xv4nC0NmTtMGag_6ValBHA==/oat/arm64/base.odex
12-19 15:18:35.795 18961 19054 E AndroidRuntime:
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at lib_burst_generated.Unity.Entities.EntityComponentStore.InstantiateEntitiesOne(Unity.Entities.EntityComponentStore* this, Unity.Entities.Entity srcEntity, Unity.Entities.Entity* outputEntities, int instanceCount, Unity.Entities.EntityComponentStore.InstantiateRemapChunk* remapChunks, int remapChunksCount, bool removePrefab)_AB9C1270D2EF1866(Unity.Entities.EntityComponentStore.InstantiateEntitiesOne:84)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at lib_burst_generated.Unity.Entities.EntityCommandBuffer.PlaybackUnmanagedCommandInternal(Unity.Entities.EntityDataAccess* mgr, Unity.Entities.BasicCommand* header, ref Unity.Entities.ECBSharedPlaybackState playbackState, Unity.Entities.PlaybackPolicy playbackPolicy, Unity.Collections.LowLevel.Unsafe.UnsafeList* managedReferenceIndexRemovalCount, ref Unity.Entities.EntityComponentStore.ArchetypeChanges archetypeChanges)_5F1A00C44E31E45B(Unity.Entities.EntityCommandBuffer.PlaybackUnmanagedCommandInternal:4444)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at lib_burst_generated.34146f210f5f72cb3338fe0fb7212d4f(34146f210f5f72cb3338fe0fb7212d4f:176)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at libil2cpp.0xcec9cc(Native Method)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at libil2cpp.0x12b07f0(Native Method)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at libil2cpp.0x188dde4(Native Method)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at libil2cpp.0x188b880(Native Method)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at libil2cpp.0x18450e0(Native Method)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at libil2cpp.0x1845168(Native Method)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at libil2cpp.0x1880f10(Native Method)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at libil2cpp.0x1883df4(Native Method)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at libil2cpp.0x1880f10(Native Method)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at libil2cpp.0x1c0e660(Native Method)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at libil2cpp.0xa3d13c(Native Method)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at libil2cpp.0xdbc054(Native Method)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at libunity.0x353850(Native Method)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at libunity.0x36026c(Native Method)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at libunity.0x2a26b8(Native Method)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at libunity.0x2a266c(Native Method)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at libunity.0x2a28b0(Native Method)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at libunity.0x3c7750(Native Method)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at libunity.0x3dacf0(Native Method)
12-19 15:18:35.795 18961 19054 E AndroidRuntime: at base.0x456cc(Native Method)
Looking up 34146f210f5f72cb3338fe0fb7212d4f
in lib_burst_generated.txt
yields:
--method=Unity.Entities.EntityCommandBuffer, Unity.Entities, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::_mono_to_burst_PlaybackChainChunk(System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|Unity.Entities.EntityComponentStore+ArchetypeChanges&, Unity.Entities, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|Unity.Entities.ECBSharedPlaybackState&, Unity.Entities, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|Unity.Entities.PlaybackPolicy, Unity.Entities, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null)--34146f210f5f72cb3338fe0fb7212d4f
This error happens in like 1/20 or so scene changes and might possibly be related to me destroying the entire default world and recreating it? So maybe an ECB is running on a disposed world.
This is the code I’m using:
public static IEnumerator DestroyAndCreateDefaultWorld() {
/* Destroy the default world: */
var defaultWorld = World.DefaultGameObjectInjectionWorld;
var entityManager = defaultWorld.EntityManager;
entityManager.CompleteAllJobs();
/* Destroy */
entityManager.DestroyEntity(entityManager.UniversalQuery);
yield return new WaitForEndOfFrame();
/* Disable all systems: */
foreach (var system in defaultWorld.Systems) {
system.Enabled = false;
}
yield return new WaitForEndOfFrame();
/* Actually dispose of the world: */
defaultWorld.Dispose();
/* Take it out of the player loop: */
ScriptBehaviourUpdateOrder.RemoveWorldFromCurrentPlayerLoop(defaultWorld);
/* Reinitialize the default world: */
DefaultWorldInitialization.Initialize("Default World");
}
Again, not sure if it’s related to the crash even, but I figured I’d add the snippet.
This has worked without a hitch during many many hours of debugging and testing in the editor, but in the Android player it will crash about 5% of the time.
Anyone has a clue on how to approach this?
Thanks,
Nico