Search Unity

Bug Burst Crash in Unity.Entities.EntityComponentStore.InstantiateEntitiesOne

Discussion in 'Burst' started by nicolasgramlich, Dec 19, 2020.

  1. nicolasgramlich

    nicolasgramlich

    Joined:
    Sep 21, 2017
    Posts:
    231
    Hey everyone,

    I'm currently trying to track down a crash somewhere around
    Unity.Entities.EntityComponentStore.InstantiateEntitiesOne
    :

    Code (CSharp):
    1. 12-19 15:18:35.795 18961 19054 E AndroidRuntime: FATAL EXCEPTION: UnityMain
    2. 12-19 15:18:35.795 18961 19054 E AndroidRuntime: Process: com.legioncommander, PID: 18961
    3. 12-19 15:18:35.795 18961 19054 E AndroidRuntime: java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    4. 12-19 15:18:35.795 18961 19054 E AndroidRuntime: Version '2020.1.17f1 (9957aee8edc2)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
    5. 12-19 15:18:35.795 18961 19054 E AndroidRuntime: Build fingerprint: 'google/coral/coral:11/RQ1A.201205.008/6943376:user/release-keys'
    6. 12-19 15:18:35.795 18961 19054 E AndroidRuntime: Revision: 'MP1.0'
    7. 12-19 15:18:35.795 18961 19054 E AndroidRuntime: ABI: 'arm64'
    8. 12-19 15:18:35.795 18961 19054 E AndroidRuntime: Timestamp: 2020-12-19 15:18:35-0800
    9. 12-19 15:18:35.795 18961 19054 E AndroidRuntime: pid: 18961, tid: 19054, name: UnityMain  >>> com.legioncommander <<<
    10. 12-19 15:18:35.795 18961 19054 E AndroidRuntime: uid: 10512
    11. 12-19 15:18:35.795 18961 19054 E AndroidRuntime: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
    12. 12-19 15:18:35.795 18961 19054 E AndroidRuntime: Cause: null pointer dereference
    13. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     x0  00000076c12d5c50  x1  0000000000001209  x2  0000000000000001  x3  00000077701cb190
    14. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     x4  0000000000000001  x5  0000000000000000  x6  0000000000000000  x7  0000000000000001
    15. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     x8  00000077701caa61  x9  0000000000012090  x10 00000077c8dad2dc  x11 0000000000000000
    16. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     x12 0000000000000050  x13 0000000000000000  x14 00000076700594c0  x15 0000000000000000
    17. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     x16 000000774c121970  x17 0000007a6dcbc520  x18 0000000000000032  x19 0000000000000001
    18. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     x20 00000076c12d5c50  x21 000000770011d5b8  x22 00000077701cafd8  x23 0000007670059440
    19. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     x24 0000000000000000  x25 00000077701cac90  x26 000000770011d5b8  x27 0000000000000001
    20. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     x28 00000076700594c8  x29 00000077701caf20
    21. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     sp  00000077701caa60  lr  00000077c8dae330  pc  00000077c8db15d8
    22. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:
    23. 12-19 15:18:35.795 18961 19054 E AndroidRuntime: backtrace:
    24. 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)
    25. 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)
    26. 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)
    27. 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)
    28. 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)
    29. 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)
    30. 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)
    31. 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)
    32. 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)
    33. 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)
    34. 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)
    35. 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)
    36. 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)
    37. 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)
    38. 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)
    39. 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)
    40. 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)
    41. 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)
    42. 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)
    43. 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)
    44. 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)
    45. 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)
    46. 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
    47. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:
    48. 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)
    49. 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)
    50. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     at lib_burst_generated.34146f210f5f72cb3338fe0fb7212d4f(34146f210f5f72cb3338fe0fb7212d4f:176)
    51. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     at libil2cpp.0xcec9cc(Native Method)
    52. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     at libil2cpp.0x12b07f0(Native Method)
    53. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     at libil2cpp.0x188dde4(Native Method)
    54. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     at libil2cpp.0x188b880(Native Method)
    55. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     at libil2cpp.0x18450e0(Native Method)
    56. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     at libil2cpp.0x1845168(Native Method)
    57. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     at libil2cpp.0x1880f10(Native Method)
    58. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     at libil2cpp.0x1883df4(Native Method)
    59. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     at libil2cpp.0x1880f10(Native Method)
    60. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     at libil2cpp.0x1c0e660(Native Method)
    61. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     at libil2cpp.0xa3d13c(Native Method)
    62. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     at libil2cpp.0xdbc054(Native Method)
    63. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     at libunity.0x353850(Native Method)
    64. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     at libunity.0x36026c(Native Method)
    65. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     at libunity.0x2a26b8(Native Method)
    66. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     at libunity.0x2a266c(Native Method)
    67. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     at libunity.0x2a28b0(Native Method)
    68. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     at libunity.0x3c7750(Native Method)
    69. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     at libunity.0x3dacf0(Native Method)
    70. 12-19 15:18:35.795 18961 19054 E AndroidRuntime:     at base.0x456cc(Native Method)
    Looking up
    34146f210f5f72cb3338fe0fb7212d4f
    in
    lib_burst_generated.txt
    yields:

    Code (CSharp):
    1. --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:

    Code (CSharp):
    1. public static IEnumerator DestroyAndCreateDefaultWorld() {
    2.             /* Destroy the default world: */
    3.             var defaultWorld = World.DefaultGameObjectInjectionWorld;
    4.             var entityManager = defaultWorld.EntityManager;
    5.  
    6.             entityManager.CompleteAllJobs();
    7.  
    8.             /* Destroy */
    9.             entityManager.DestroyEntity(entityManager.UniversalQuery);
    10.  
    11.             yield return new WaitForEndOfFrame();
    12.  
    13.             /* Disable all systems: */
    14.             foreach (var system in defaultWorld.Systems) {
    15.                 system.Enabled = false;
    16.             }
    17.  
    18.             yield return new WaitForEndOfFrame();
    19.  
    20.             /* Actually dispose of the world: */
    21.             defaultWorld.Dispose();
    22.  
    23.             /* Take it out of the player loop: */
    24.             ScriptBehaviourUpdateOrder.RemoveWorldFromCurrentPlayerLoop(defaultWorld);
    25.  
    26.             /* Reinitialize the default world: */
    27.             DefaultWorldInitialization.Initialize("Default World");
    28.         }
    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
     
    ababab5 likes this.
  2. ababab5

    ababab5

    Joined:
    Apr 15, 2014
    Posts:
    508
    Hello! Do you find a solution? We have the same issue here :(