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.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Bug Havok crashes when dynamically invalidating collider components (Case 1420910)

Discussion in 'DOTS Physics' started by Lukas_Kastern, Apr 18, 2022.

  1. Lukas_Kastern

    Lukas_Kastern

    Joined:
    Aug 31, 2018
    Posts:
    95
    Hey,

    I recently started noticing quite a few crashes related to Havok. After investigating it a bit I managed to narrow it down to a new feature I added. This feature sets physics colliders to default(null) when a certain condition is met.

    I thought this would be fine since the PhysicsCollider.Value field itself has a comment next to it that states 'null is allowed'. But apparently setting it to null while a dynamic body intersects/collides with it will cause a crash.

    This crash only happens when using the Havok backend, Unity Physics works fine.
    Another workaround is to use a collider with a zero collision filter instead of setting it to default.

    I attached a repro project and one of my many crash dumps to the case.
     
  2. JosepMariaPujol

    JosepMariaPujol

    Unity Technologies

    Joined:
    Jun 16, 2021
    Posts:
    37
    I will forward this issue to the Havok team, thanks for posting.
     
    Lukas_Kastern likes this.
  3. JosepMariaPujol

    JosepMariaPujol

    Unity Technologies

    Joined:
    Jun 16, 2021
    Posts:
    37
    Looks like you forgot to attach the project to your post.
     
    Last edited: Apr 23, 2022
    Lukas_Kastern likes this.
  4. Lukas_Kastern

    Lukas_Kastern

    Joined:
    Aug 31, 2018
    Posts:
    95
    Huh, maybe I pressed the submit button too quickly lol.
    Anyways here is the project. I added another scene called 'FreezeScene' for another Havok-related bug that I didn't get to report yet. That one causes the executable to freeze when a dynamic body that uses a completely flat ConvexHull collides with another shape.
     

    Attached Files:

    JosepMariaPujol likes this.
  5. JosepMariaPujol

    JosepMariaPujol

    Unity Technologies

    Joined:
    Jun 16, 2021
    Posts:
    37
    Hi, @Lukas_Kastern.
    After opening HavokCrash.zip we can only reproduce the FreezeScene scene using the Havok engine.
    Regarding the CrashScene nothing crashes on our machine, the PhysicsShape simply goes on and off due to the output from the sin() function. Let us know again how do you get to that crash.
     
  6. Lukas_Kastern

    Lukas_Kastern

    Joined:
    Aug 31, 2018
    Posts:
    95
    Once you go in-game while having the CrashScene open you should be able to spawn a cube by pressing space. Once this cube intersects with the static shape it should crash.
    But I just noticed that when you have burst enabled an exception is thrown which makes the crash not happen. Once you disable burst you should be able to reproduce the crash tho.
     
    JosepMariaPujol likes this.
  7. JosepMariaPujol

    JosepMariaPujol

    Unity Technologies

    Joined:
    Jun 16, 2021
    Posts:
    37
    We could successfully reproduce this bug after disabling burst, mind the difference
     
    Last edited: Apr 26, 2022
    Lukas_Kastern likes this.