Search Unity

New Crash in 0.0.12-preview.32 of Entities

Discussion in 'Data Oriented Technology Stack' started by LastResortMatthew, May 17, 2019.

  1. LastResortMatthew

    LastResortMatthew

    Joined:
    Apr 10, 2019
    Posts:
    36
    Apologies if this is the wrong place to post this!

    It seems like today's update to the Entities package has introduced a crash in

    EntityManager.AddComponent(NativeArray<Entity> entities, ComponentType componentType);


    Easily reproducible in preview.32, can't reproduce it in preview.31

    Triggering code:
    Code (CSharp):
    1.                 var treesToCheck = new NativeArray<Entity>(filteredIndices.Length, Allocator.TempJob);
    2.                 result = new BuildArrayJob
    3.                 {
    4.                     UnfilteredEntities = uncheckedTrees,
    5.                     FilteredIndices = filteredIndices.AsArray(),
    6.                     FilteredEntities = treesToCheck
    7.                 }.Schedule(filteredIndices.Length, 8, result);
    8.                 result.Complete();
    9.  
    10.                 // Mark all of those trees as Checked
    11.                 EntityManager.AddComponent(treesToCheck, typeof(Checked));
    Stacktrace:
    Code (CSharp):
    1. 0x00007FF70C2EAC1E (Unity) memcpy_repmovs
    2. 0x00007FF70AE59B8B (Unity) UnsafeUtility_CUSTOM_MemCpy
    3. 0x00000161C2C0BA10 (Mono JIT Code) (wrapper managed-to-native) Unity.Collections.LowLevel.Unsafe.UnsafeUtility:MemCpy (void*,void*,long)
    4. 0x00000161C3CEA203 (Mono JIT Code) [D:\unity\LastResort\unity\Library\PackageCache\com.unity.entities@0.0.12-preview.32\Unity.Entities\ChunkDataUtility.cs:341] Unity.Entities.ChunkDataUtility:Convert (Unity.Entities.Chunk*,int,Unity.Entities.Chunk*,int,int)
    5. 0x00000161C395F403 (Mono JIT Code) [D:\unity\LastResort\unity\Library\PackageCache\com.unity.entities@0.0.12-preview.32\Unity.Entities\EntityManagerChangeArchetypeUtility.cs:694] Unity.Entities.EntityManagerChangeArchetypeUtility/PackBlittableChunkData:Execute ()
    6. 0x00000161C395EC1B (Mono JIT Code) [C:\buildslave\unity\build\Runtime\Jobs\Managed\IJob.cs:31] Unity.Jobs.IJobExtensions/JobStruct`1<Unity.Entities.EntityManagerChangeArchetypeUtility/PackBlittableChunkData>:Execute (Unity.Entities.EntityManagerChangeArchetypeUtility/PackBlittableChunkData&,intptr,intptr,Unity.Jobs.LowLevel.Unsafe.JobRanges&,int)
    7. 0x00000161C395EEB5 (Mono JIT Code) (wrapper delegate-invoke) Unity.Jobs.IJobExtensions/JobStruct`1/ExecuteJobFunction<Unity.Entities.EntityManagerChangeArchetypeUtility/PackBlittableChunkData>:invoke_void_T&_intptr_intptr_JobRanges&_int (Unity.Entities.EntityManagerChangeArchetypeUtility/PackBlittableChunkData&,intptr,intptr,Unity.Jobs.LowLevel.Unsafe.JobRanges&,int)
    8. 0x00000161C2CED8AB (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___intptr&_intptr_intptr_intptr&_int (object,intptr,intptr,intptr)
    9. 0x00007FF93526C11B (mono-2.0-bdwgc) [c:\users\builduser\builds\tsuywz8z\0\vm\mono\mono\mini\mini-runtime.c:2809] mono_jit_runtime_invoke
    10. 0x00007FF9351F2282 (mono-2.0-bdwgc) [c:\users\builduser\builds\tsuywz8z\0\vm\mono\mono\metadata\object.c:2921] do_runtime_invoke
    11. 0x00007FF9351FB27F (mono-2.0-bdwgc) [c:\users\builduser\builds\tsuywz8z\0\vm\mono\mono\metadata\object.c:2968] mono_runtime_invoke
    12. 0x00007FF70AD19C32 (Unity) scripting_method_invoke
    13. 0x00007FF70AD138F1 (Unity) ScriptingInvocation::Invoke
    14. 0x00007FF70A6CB051 (Unity) ExecuteJob
    15. 0x00007FF70A6CBEBA (Unity) ForwardJobToManaged
    16. 0x00007FF70A6BD11E (Unity) JobQueue::Exec
    17. 0x00007FF70A6C3E9C (Unity) JobQueue::WaitForJobGroupID
    18. 0x00007FF70A6A0608 (Unity) CompleteFenceInternal
    19. 0x00007FF70AEA11E1 (Unity) JobHandle_CUSTOM_ScheduleBatchedJobsAndComplete
    20. 0x00000161C2CED57E (Mono JIT Code) (wrapper managed-to-native) Unity.Jobs.JobHandle:ScheduleBatchedJobsAndComplete (Unity.Jobs.JobHandle&)
    21. 0x00000161C2CD6CFB (Mono JIT Code) [C:\buildslave\unity\build\Runtime\Jobs\ScriptBindings\JobHandle.bindings.cs:21] Unity.Jobs.JobHandle:Complete ()
    22. 0x00000161C395A883 (Mono JIT Code) [D:\unity\LastResort\unity\Library\PackageCache\com.unity.entities@0.0.12-preview.32\Unity.Entities\EntityManagerChangeArchetypeUtility.cs:215] Unity.Entities.EntityManagerChangeArchetypeUtility:AddComponent (Unity.Collections.NativeList`1<Unity.Entities.EntityBatchInChunk>,Unity.Entities.ComponentType,int,Unity.Entities.EntityComponentStore*,Unity.Entities.ManagedComponentStore,Unity.Entities.EntityGroupManager)
    23. 0x00000161D2E71083 (Mono JIT Code) [D:\unity\LastResort\unity\Library\PackageCache\com.unity.entities@0.0.12-preview.32\Unity.Entities\EntityManagerChangeArchetype.cs:83] Unity.Entities.EntityManager:AddComponent (Unity.Collections.NativeArray`1<Unity.Entities.Entity>,Unity.Entities.ComponentType)
    24. 0x00000161D294555B (Mono JIT Code) [D:\unity\LastResort\unity\Assets\Scripts\Systems\DemolishTreeSystemV2.cs:150] DemolishTreeSystemV2:ProcessEvent (DemolishTreeEvent,int,Unity.Jobs.JobHandle&)
    25. 0x00000161C39296B6 (Mono JIT Code) [D:\unity\LastResort\unity\Assets\Scripts\Systems\JobEventSystem.cs:32] JobEventSystem`1<DemolishTreeEvent>:OnUpdate (Unity.Jobs.JobHandle)
    26. 0x00000161C2CEF50B (Mono JIT Code) [D:\unity\LastResort\unity\Library\PackageCache\com.unity.entities@0.0.12-preview.32\Unity.Entities\ComponentSystem.cs:840] Unity.Entities.JobComponentSystem:InternalUpdate ()
    27. 0x00000161C2CD2FC4 (Mono JIT Code) [D:\unity\LastResort\unity\Library\PackageCache\com.unity.entities@0.0.12-preview.32\Unity.Entities\ComponentSystem.cs:242] Unity.Entities.ComponentSystemBase:Update ()
    28. 0x00000161C2CD502B (Mono JIT Code) [D:\unity\LastResort\unity\Library\PackageCache\com.unity.entities@0.0.12-preview.32\Unity.Entities\ComponentSystemGroup.cs:373] Unity.Entities.ComponentSystemGroup:OnUpdate ()
    29. 0x00000161C2CD335B (Mono JIT Code) [D:\unity\LastResort\unity\Library\PackageCache\com.unity.entities@0.0.12-preview.32\Unity.Entities\ComponentSystem.cs:720] Unity.Entities.ComponentSystem:InternalUpdate ()
    30. 0x00000161C2CD2FC4 (Mono JIT Code) [D:\unity\LastResort\unity\Library\PackageCache\com.unity.entities@0.0.12-preview.32\Unity.Entities\ComponentSystem.cs:242] Unity.Entities.ComponentSystemBase:Update ()
    31. 0x00000161C2CD502B (Mono JIT Code) [D:\unity\LastResort\unity\Library\PackageCache\com.unity.entities@0.0.12-preview.32\Unity.Entities\ComponentSystemGroup.cs:373] Unity.Entities.ComponentSystemGroup:OnUpdate ()
    32. 0x00000161C2CD335B (Mono JIT Code) [D:\unity\LastResort\unity\Library\PackageCache\com.unity.entities@0.0.12-preview.32\Unity.Entities\ComponentSystem.cs:720] Unity.Entities.ComponentSystem:InternalUpdate ()
    33. 0x00000161C2CD2FC4 (Mono JIT Code) [D:\unity\LastResort\unity\Library\PackageCache\com.unity.entities@0.0.12-preview.32\Unity.Entities\ComponentSystem.cs:242] Unity.Entities.ComponentSystemBase:Update ()
    34. 0x00000161C2CD2E6B (Mono JIT Code) [D:\unity\LastResort\unity\Library\PackageCache\com.unity.entities@0.0.12-preview.32\Unity.Entities\ScriptBehaviourUpdateOrder.cs:135] Unity.Entities.ScriptBehaviourUpdateOrder/DummyDelegateWrapper:TriggerUpdate ()
    35. 0x0000016191F673D8 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
    36. 0x00007FF93526C11B (mono-2.0-bdwgc) [c:\users\builduser\builds\tsuywz8z\0\vm\mono\mono\mini\mini-runtime.c:2809] mono_jit_runtime_invoke
    37. 0x00007FF9351F2282 (mono-2.0-bdwgc) [c:\users\builduser\builds\tsuywz8z\0\vm\mono\mono\metadata\object.c:2921] do_runtime_invoke
    38. 0x00007FF9351FB27F (mono-2.0-bdwgc) [c:\users\builduser\builds\tsuywz8z\0\vm\mono\mono\metadata\object.c:2968] mono_runtime_invoke
    39. 0x00007FF70AD19C32 (Unity) scripting_method_invoke
    40. 0x00007FF70AD138F1 (Unity) ScriptingInvocation::Invoke
    41. 0x00007FF70A7E14DB (Unity) ExecutePlayerLoop
    42. 0x00007FF70A7E14F9 (Unity) ExecutePlayerLoop
    43. 0x00007FF70A7E636B (Unity) PlayerLoop
    44. 0x00007FF708DDD6DB (Unity) PlayerLoopController::UpdateScene
    45. 0x00007FF708DDB1DC (Unity) Application::TickTimer
    46. 0x00007FF709650D05 (Unity) MainMessageLoop
    47. 0x00007FF70965373F (Unity) WinMain
    48. 0x00007FF70C2C8252 (Unity) __scrt_common_main_seh
    49. 0x00007FF9ACCA7974 (KERNEL32) BaseThreadInitThunk
    50. 0x00007FF9AD1EA271 (ntdll) RtlUserThreadStart
    51.  
    52. ========== END OF STACKTRACE ===========

    Full crash folder attached.
     

    Attached Files:

  2. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    4,632
    Do you have a small project folder that reproduces the issue?
     
  3. wobes

    wobes

    Joined:
    Mar 9, 2013
    Posts:
    663
    IJobForeach_B also crashes the unity.
     
  4. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    4,632
    Please make a repro project for that as well.
     
  5. LastResortMatthew

    LastResortMatthew

    Joined:
    Apr 10, 2019
    Posts:
    36
    I'll try to put something together on Monday
     
  6. LastResortMatthew

    LastResortMatthew

    Joined:
    Apr 10, 2019
    Posts:
    36
  7. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    4,632
    Thanks, will be fixed in p33
     
    LastResortMatthew likes this.
  8. Dale_Kim

    Dale_Kim

    Unity Technologies

    Joined:
    May 8, 2019
    Posts:
    10
    As @Joachim_Ante mentioned, this should be fixed in preview 33 which is available now. Please check it out!
     
    LastResortMatthew likes this.
  9. LastResortMatthew

    LastResortMatthew

    Joined:
    Apr 10, 2019
    Posts:
    36
    Yep it's fixed, thanks so much!