Search Unity

  1. Engage, network and learn at Unite Austin 2017, Oct 3 - 5. Get your ticket today!
    Dismiss Notice
  2. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  3. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  4. Unity 2017.1 is now released.
    Dismiss Notice
  5. Unity 2017.2 beta is now available for download.
    Dismiss Notice

Unmanaged crash in Physx (5.5.4.p1)

Discussion in 'Physics' started by AndersMalmgren, Sep 5, 2017.

  1. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    703
    We have a new problem with Physics. We get an unmanaged crash while playing the game, here is the stack traces from two different machines


    Also we get this exception without unmanaged crash

     
  2. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    703
    Should we submit a bug report maybe? This bug is serious for us since our game is in early access on Steam and thus already Published
     
  3. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    703
    I opened a bug we need this sorted ASAP
     
  4. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    703
    We are getting desperate here guys, the crash has only happened two times so far, but we get alot of these kind of errors. Sometimes with complete loss of framerate, sometimes you dont even notice it.

    [​IMG]

    edit: This bug happened because we had a bug in our Spawn logic. For some frames all spawed items shared the same position which seemed to completly fubar physics. Its now fixed. The crash bug still happens and is probably not related at all to this problem
     
    Last edited: Sep 20, 2017 at 12:45 PM
  5. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    703
  6. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    3,967
    maybe test copy of the project in newer unity/beta version, just to see if still happens?
     
  7. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    703
    We have tested 2017.2b9 Same thing, not the crash (Only happened two times) but we get the other exceptions.
     
  8. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    3,967
    could replace mesh colliders with primitive ones, if that makes any difference?
     
  9. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    703
    We have only primitive colliders on our rigidbody objects
     
  10. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    703
    Ok, got a bug report from one of our customers

     
  11. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    703
    Another customer reports complete crash of game

    Unity please help us out, we are a bit desperate here
     
  12. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    703
    I have tried 5.5.4.p5 which above crash was using, so no difference there
     
  13. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    5,899
    I would suggest to set up many sanity checks around the area where the problem happens.

    Sanity checks means setting up code that will verify incoming values for being NaN/INF and if anything is wrong, trip a breakpoint or dump all information you can into the logfile.

    If you can catch some sort of exception when the problem happens, I'd recommend to print transformation for the entire hierarchy at this point. Meaning starting from current object, print transform.localRotation, transform.localScale, transform.localRotation. Local, not global. Then print the same info for each of the object's parents, walking hierarchy upwards towards root.

    Most likely scenario that for whatever reason somewhere in your code there's a numerical error which results in weird behavior. Meaning a value is too small, too large, or some sort of risky operation is performed without checking.

    ------

    Now, regarding the second crash log... I'd suggest to try to pinpoint the code block that leads to it. For example, once upon a time, I've run into issue where OverlapBox would crash the game on android. However, I do not actually see any physx call in the stack trace, so it is unclear if this one even is a physx bug and not some sort of obscure local problem.
     
  14. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    703
    Those errors in that screenshot is fixed, it was a problem on our side. Its not related to the crash, should update the other thread about that.

    We do have a check now for nan, and if it occurs we log and revert to last known correct value. The crash have happened once since this fix.
    And during playtets we do detect some Nan values on the transforms. But its not because of our code, we check our netcode values carefully before we update the transforms, and for netwroked controlled objects we have disabled rigidodies. Its the physics engine that sets these invalid nan values
     
  15. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    703
    I should also state that the physics in our game is on a different level than most games

     
  16. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    5,899
    A much better idea would be to figure out what exactly causes nan values and fix the problem there. Reverting to the last known value is quick fix at best.
     
    theANMATOR2b likes this.
  17. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    703
    Yeah thats what the logging is there for, we also have a Debug.Break, but its seldom we do playtests in editor mode and it have never been reported since we starting logging
     
    Last edited: Sep 20, 2017 at 1:39 PM
  18. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    703