Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Bug Crash when converting compound colliders

Discussion in 'Physics for ECS' started by Karearea, Sep 2, 2022.

  1. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    374
    I've just updated the editor to 2021.3.9f1 and am building to macOS from an M1 Max. Entities / Physics / Havok packages are 0.51.1-preview.21. Previously on 2021.3.8 this crash didn't occur.

    In the editor, I can run the game fine using Unity Physics, but have a persistent crash in the standalone build. It seems the culprit is multiple physics shapes for a given physics body. The crash occurs if, before conversion, multiple authoring shapes are either on the same gameobject or as children of the authoring body.

    As soon as I limit any pre-converted gameobjects to a single authoring shape on the same gameobject as the authoring body, conversion works fine and there's no crash.

    This is 100% repeatable with just one pre-converted gameobject in the scene, with multiple shapes under a single body. The crash occurs with either Havok or Unity Physics selected. I can file a report, but first wanted to check there aren't any caveats when trying to create a compound collider.

    Crash log below:

    Crashed Thread: 0 Dispatch queue: com.apple.main-thread

    Exception Type: EXC_BAD_ACCESS (SIGSEGV)
    Exception Codes: KERN_INVALID_ADDRESS at 0x0000008e00000005
    Exception Codes: 0x0000000000000001, 0x0000008e00000005
    Exception Note: EXC_CORPSE_NOTIFY

    Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11
    Terminating Process: exc handler [15807]

    VM Region Info: 0x8e00000005 is not in any region. Bytes after previous region: 128849018886 Bytes before following region: 104943230910459
    REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
    commpage (reserved) 1000000000-7000000000 [384.0G] ---/--- SM=NUL ...(unallocated)
    ---> GAP OF 0x5f9000000000 BYTES
    MALLOC_NANO 600000000000-600008000000 [128.0M] rw-/rwx SM=PRV

    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0 <translation info unavailable> 0x1043f6224 ???
    1 <translation info unavailable> 0x1043f6154 ???
    2 ??? 0x12ee8baf2 86876c11ad8b63968805b88bf0d31953_x64_sse4 + 18
    3 UnityPlayer.dylib 0x10e8cb0b9 0x10e46d000 + 4579513
    4 UnityPlayer.dylib 0x10e470b7e 0x10e46d000 + 15230
    5 GameAssembly.dylib 0x1237c546b JobsUtility_Schedule_Injected_mC33968491EEF494B38CB6D6AE774D52753AEAB11 + 40 (UnityEngine.CoreModule.cpp:8593) [inlined]
    6 GameAssembly.dylib 0x1237c546b JobsUtility_Schedule_mCE884DE9598B84AB8AB49FC03B65603F15275789 + 59 (UnityEngine.CoreModule.cpp:8377)
    7 GameAssembly.dylib 0x12373a2d6 IJobExtensions_Run_TisCreateCompoundJob_tB4DEF7E46B47A526CA1BFDB15210691747E5DEE3_mBA7B23A982732D83AF9F4BC1F6C3A772752AB689_gshared + 150 (GenericMethods33.cpp:46271)
    8 GameAssembly.dylib 0x122427e9c IJobExtensions_Run_TisCreateCompoundJob_tB4DEF7E46B47A526CA1BFDB15210691747E5DEE3_mBA7B23A982732D83AF9F4BC1F6C3A772752AB689(CreateCompoundJob_tB4DEF7E46B47A526CA1BFDB15210691747E5DEE3, MethodInfo const*) + 28 (Unity.Physics.Hybrid.cpp:12834) [inlined]
    9 GameAssembly.dylib 0x122427e9c BuildCompoundCollidersConversionSystem_OnUpdate_mCCC00E9611E6A57527D18A26C584DA59F14EC502 + 4012 (Unity.Physics.Hybrid.cpp:29931)

    ..etc. Thanks!
     
    skiplist likes this.
  2. JosepMariaPujol

    JosepMariaPujol

    Unity Technologies

    Joined:
    Jun 16, 2021
    Posts:
    61
    Thanks for reporting! We were able to reproduce this bug.
     
  3. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    374
    Thanks, good to hear you could reproduce this. And sorry I didn’t file a report, I fully intended to but have been flat out with other work and it dropped off the agenda.
     
    JosepMariaPujol likes this.
  4. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    374
    Hi @JosepMariaPujol I've upgraded to 2022.2.0b8, updated the Entities packages to the new 1.0 betas and have updated according to the guide, cleared errors etc. Building with Faster (Smaller) Builds as recommended.

    I'm still getting a very similar crash, is the above expected to be fixed? I can run everything in the editor fine, so it's still a problem only in builds. No problem if it's still under investigation!
     
  5. JosepMariaPujol

    JosepMariaPujol

    Unity Technologies

    Joined:
    Jun 16, 2021
    Posts:
    61
    Hi @Karearea, it has not been fixed yet since it is still under investigation. As a workaround configuring the scripting backend to "mono" instead of "il2cpp". Thank you! :)
     
    Karearea likes this.