Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

5.6b9 crashing constantly.

Discussion in '5.6 Beta' started by sgower, Feb 27, 2017.

  1. sgower

    sgower

    Joined:
    Mar 9, 2015
    Posts:
    316
    I seem to excel at crashing (and quite often freezing) unity. I keep hoping that a new beta version will improve the situation, but 5.6b9 is crashing almost every time I run my game. Sometimes it crashes right when I start it, other times after 5 minutes, or 10 minutes. There seems to be no rhyme or reason to it. The same with the freezing. Freezing could happen if the code gets caught in a loop but if this was the case, the freeze should be repeatable. It's not, it just happens at random times. The Unity error logs always contain errors that say:

    "134217728 MB user address space [134213005 MB free].
    Read from location c09246c0 caused an access violation.
    "

    I think this must be a generic message that is written regardless of the cause, because it's the same every time. Only the hex value changes. In the Stack Trace of the error log, the only readable text is:

    0x2cfcfd20: 73796850 78502e58 70615373 7061732e PhysX.PxsSap.sap
    0x2cfcfd30: 61647055 6f576574 00006b72 00000000 UpdateWork..

    It's clear that there is something about my project that Unity dislikes, but it's a really large project and I have no idea how to troubleshoot this. Does anyone have any thoughts?
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,645
    Hey!

    We've been hearing these reports in the wild for the past couple of betas, but we were unable to reproduce them locally. Furthermore, we suspect that there is a bug in our crash handling code which makes it crash processing the crash, therefore failing to launch our bug reporter (and it also makes us not receive any information about such crashes). I assume you're facing one of those, right?

    Since you seem to have a good way to reproduce those crashes (as you say they happen often), could you help us out and modify your registry to automatically collect crash dumps on any crashed process as outlined in this document?

    https://msdn.microsoft.com/en-us/library/windows/desktop/bb787181(v=vs.85).aspx

    Use DumpType value of "2". As you collect a few dumps, zip them up, submit a bug report with them attached and post the bug number here. Hopefully with your help we can figure those issues out :).
     
  3. alexeyzakharov

    alexeyzakharov

    Joined:
    Jul 2, 2014
    Posts:
    507
    Hi,
    Thanks for reporting the issue!

    Looks like a symptoms of memory corruption.
    It would be very helpful to run Unity Editor x64 with -debugallocator cmdline option. This would help to receive a callstack for the crash which is closer to the actual failure point.
     
  4. sgower

    sgower

    Joined:
    Mar 9, 2015
    Posts:
    316
    Thanks guys, I don't have time to follow the above advice immediately, but I will definitely check into doing these things. I will say this: While my project is still crashing sometimes, it seems to be behaving a lot better after reverting to the previous version of the SteamVR plugin. I suppose it could be the case that the latest SteamVR plugin update isn't working so well with the latest 5.6 beta, so if this is something you can test in-house, you might want to try it. I'm a little disappointed with Valve regarding this latest plugin update as it caused a few different compile issues relating to some method signatures changing. Bad Valve!

    I still have the copy of my project (with the new plugin) on hand, so I could test it again, verify that it's still crashing for me, and follow your suggestion. I'll definitely try to help with this as I'm highly motivated to have 5.6 release be as stable as possible.
     
  5. sgower

    sgower

    Joined:
    Mar 9, 2015
    Posts:
    316
    Hey, since I seem to have your ear, I wonder if I can change the subject a bit. I've stumbled across something that may or may not be a bug that I'd like to run by you. If it's a bug, it seems like a bad one. If it's not a bug, then I have some code to re-write!

    I'm wondering if this is broken (From the Object.Instantiate docs:
    "When you clone a GameObject or Component, all child objects and components will also be cloned with their properties set like those of the original object."

    Check out the following code:
    Code (CSharp):
    1.  Rotation childObjectRotation=childObject.GetComponent<Rotation>();
    2.         Debug.Log("childObjectRotation activateString=" + childObjectRotation.activateString);
    3.         Debug.Log("childObjectRotation testString=" + childObjectRotation.testString);
    4.         GameObject bullet = (GameObject)Instantiate(childObject, transform.position + transform.forward * (parentSize + .01f), Quaternion.identity);
    5.         Rotation bulletObjectRotation = bullet.GetComponent<Rotation>();
    6.         Debug.Log("bulletObjectRotation activateString=" + bulletObjectRotation.activateString);
    7.         Debug.Log("bulletObjectRotation testString=" + bulletObjectRotation.testString);
    My output looks like this:
    Code (CSharp):
    1. childObjectRotation activateString=When Scene Played
    2. childObjectRotation testString=goobers
    3. bulletObjectRotation activateString=
    4. bulletObjectRotation testString=goobers
    So in the example above the "testString" of the cloned object matches the value set in the original object (childObject).
    But the "activateString" in the cloned object is empty.

    Shouldn't the values for both variables be getting copied by the Instantiate call?

    The difference between these two variables is that activateString is a property overridden from an abstract parent class. "testString" is a variable (I'm setting the value to "goobers" in my example) existing in the Rotation.cs class.

    Code (CSharp):
    1.     public override string activateString { get; set; }
    2.  public string testString = "";
    Let me know if you have any helpful information about this. If not, then perhaps I'll find a more appropriate thread to ask this question on. Thanks!
     
    Last edited: Mar 1, 2017
  6. sgower

    sgower

    Joined:
    Mar 9, 2015
    Posts:
    316
    I'm such a dumb ass. For some reason I thought I was just seeing this issue tonight for the first time, but then it occurred to me that just last week, I not only encountered this issue, but wrote code to work around it.
    Still I wonder: Should I have needed to write this?

    The method I wrote is somewhat hardcoded for my needs, but you can get the idea about what I'm doing.
    The script basically copies the script parameters form the original object to the clone object. "IPlayable" is the abstract class I mentioned in the previous post.

    Code (CSharp):
    1.     public static void copyScriptVariables(GameObject originalObject, GameObject cloneObject) {
    2.         //For each Iplayable, copy the properties from the original object to the cloned object.
    3.        List<GameObject> originalObjects= LogsUtil.GetChildrenByTag(originalObject, "log");
    4.         List<GameObject> clonedObjects = LogsUtil.GetChildrenByTag(originalObject, "log");
    5.         IPlayable[] originalIPlayables = originalObject.GetComponentsInChildren<IPlayable>();
    6.         IPlayable[] cloneIPlayables = cloneObject.GetComponentsInChildren<IPlayable>();
    7.         for (int i = 0; i < cloneIPlayables.Length; i++) {
    8.             IPlayable ip = cloneIPlayables[i];
    9.             IPlayable oip = originalIPlayables[i];
    10.             string[] saveParams = ip.getSaveParams().Split(',');
    11.             for (int j = 0; j < saveParams.Length; j++) {
    12.                 string thisPropertyName = saveParams[j];
    13.                 PropertyInfo pinfo = ip.GetPropertyInfo(thisPropertyName);
    14.                 if (pinfo.PropertyType == typeof(string)) {
    15.                     ip.SetPropertyValue(thisPropertyName, (string)oip.GetPropertyValue(thisPropertyName));
    16.                 } else {
    17.                     ip.SetPropertyValue(thisPropertyName, (int)oip.GetPropertyValue(thisPropertyName));
    18.                 }
    19.             }
    20.         }
    21.         //Then call startMe because sometimes important stuff happens here.
    22.         IPlayable[] cloneIPlayabless = cloneObject.GetComponentsInChildren<IPlayable>();
    23.         for (int i = 0; i < cloneIPlayabless.Length; i++) {
    24.             IPlayable ip = cloneIPlayabless[i];
    25.             ip.StartMe();
    26.         }
    27.     }
    I just re-tested my code after making a call to this method, and both variables are printing correctly in the cone copy. If it turns out that Unity Instantiate doesn't include code to copy these kinds of properties, then maybe you should add it! When an object is cloned, it really ought to match the original as much as possible. Right? I'm curious to hear your thoughts on the subject. Thanks.
     
    Last edited: Mar 1, 2017
  7. alexeyzakharov

    alexeyzakharov

    Joined:
    Jul 2, 2014
    Posts:
    507
    This is a limitation of Unity serialization system - no support for abstract classes. (See more details in Serialization in Unity blogpost).
    Instantiate internally uses the serialization to clone a UnityEngine.Object, thus you don't see abstract members in the copy.
     
  8. sgower

    sgower

    Joined:
    Mar 9, 2015
    Posts:
    316
    I see, thanks. At least I found a way to work around this.
     
  9. sgower

    sgower

    Joined:
    Mar 9, 2015
    Posts:
    316
    Hi, so going back to the original subject, when I ran using -debugallocator, this caused the game to crash every time within seconds. I'm not sure how valuable these crash reports would be given that the debug thingy seemed to be the cause of the crash. I've opened Case 886751 and added several (maybe 8 or 9) crash reports that I've had in the last day. Tautvydas-Zilys suggested I edit my registry to "collect crash dumps". Would this provide any benefit over me just collecting the dumps that Unity is creating? I'm more than happy to do whatever else I can to help you troubleshoot these issues, but I don't want to mess with my registry unless I really need to. Please let me know, thanks. FYI - Currently my game is crashing once every 30-60 minutes. Not great, but at least I can work, unlike the crashes every 2 minutes I had been seeing.
     
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,645
    Actually, that's exactly the point of the debug allocator - it causes Unity to crash as soon as something goes wrong, rather than 10 minutes later when the traces of the thing that went wrong are already cold. Crash dumps are super useful - the reason I asked to make that registry key is that some people reported that unity was not creating dumps - we were worried that our dump creation code sometimes fails and were hoping this would make sure the dump was created. Please send us the dumps you have :).
     
  11. sgower

    sgower

    Joined:
    Mar 9, 2015
    Posts:
    316
    ok, well I turned it back on and collected a few dumps. My project is crashing Unity within a few seconds. I'm of course highly motivated to help you troubleshoot these kinds of crashes, so let me know if there's anything else I can do to help!

    Case 886900
     
  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,645
    Thanks, we're looking at the dumps now.
     
  13. sgower

    sgower

    Joined:
    Mar 9, 2015
    Posts:
    316
    Did those dumps turn out to be helpful?
     
  14. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,645
    Yes! I asked physics devs to comment - it seems that you're hitting a bug which was super hard for us to reproduce historically.
     
  15. sgower

    sgower

    Joined:
    Mar 9, 2015
    Posts:
    316
    ok, great to hear.
     
  16. sgower

    sgower

    Joined:
    Mar 9, 2015
    Posts:
    316
    FYI - I found what seems to be a repeatable bug. When I change PhysicManager Default Solver Velocity from 1 to 10, Unity freezes every time without opening the bug window. I took a dump using the Task Manager attacked to Case 888871
     
    Last edited: Mar 8, 2017
  17. sgower

    sgower

    Joined:
    Mar 9, 2015
    Posts:
    316
    Also opened Case 888908 because I'm now seeing freezes even when I'm not adjusting the PhysicsManager settings. Once again, I attached a dump for this freeze. thanks.
     
  18. sgower

    sgower

    Joined:
    Mar 9, 2015
    Posts:
    316
    Hi, I'm guessing that the Physics devs are still looking at this, and that 5.6b11 does not contain any fixes. Is this correct? I ask because I've had an especially bad day of both crashes and freezes, so decided to try 5.6b11. It seems that 5.6b11 is crashing just as often.
     
  19. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,645
    Yeah, it's still under investigation.
     
  20. JustAnotherDude

    JustAnotherDude

    Joined:
    Oct 28, 2013
    Posts:
    279
    Also running on the same issue as OP :

    0x005fd9d0: 73796850 78502e58 70615373 7061732e PhysX.PxsSap.sap
    0x005fd9e0: 61647055 6f576574 00006b72 00000000 UpdateWork......

    Is there a link to the issue tracker with this issue ?

    Running on 5.2.2p2.
     
  21. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    595
    Hey,

    I can confirm that it's a duplicate of https://issuetracker.unity3d.com/is...hupdate-after-indeterminate-time-in-play-mode. Someone named @freyaprogrammer added a fantastic repro in the comments, we're investigating it with Nvidia at the moment.

    There is no fix available yet, but I can tell that this problem happened in 5.5 too. Seems to have regressed with the upgrade to PhysX 3.3.3, but I do have occasional reports of this crash happening as early as 5.0.

    The nature of the problem is fairly random, can't really share any decent workarounds yet. One particular idea that is clear at this point is the problem relates to MeshColliders and enabling/disabling GameObjects. Probably you could replace some of your most often enabled-disabled colliders with the primitive ones -- CapsuleCollider, BoxCollider, etc. This should make the crash go away.

    Anthony
     
  22. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,589
    I think so too!

    However, if I send a bug-report to Unity that contains a crash.dmp only, QA asks for the full project. If I'm unable to provide that, the bug is closed in most cases. Either these crash.dmp files do not contain information and should be improved, or QA isn't aware that a programmer is often able to fix a crash-bug having such dump only. Crashes are unacceptable and these crash dumps should be passed to a programmer always imo.

    Being a programmer myself, I did fix crashes having such dumps only, back when we used in-house tech. For example, when Microsoft sent us a crash dump that occurred during TCR, you better know how to make use of it and fix that bug.

    Therefore, I know that it's possible (with other tech at least), but somehow it doesn't seem so with Unity, which is worrisome to me.
     
  23. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    595
    Let me assure you again that this crash is being worked on as we speak. It's a crash happening after something goes wrong deep inside PhysX. Thanks for all the information that you guys provided here and elsewhere, that helped a lot.

    As for the crash dumps, they are really useful indeed, please do keep them coming. At least to be able to relate bugs to each other and check for duplicates. And yes, it is possible to fix a bug being provided with a crash dump only. It might just take indefinitely more time. There is a lot of guesswork involved, and a bit of reverse engineering too. Especially if there was no project attached or the issue was hardware-specific.

    Anthony
     
  24. MarkSchramm

    MarkSchramm

    Joined:
    Nov 5, 2013
    Posts:
    8
    Hi everyone,

    I am seeing this issue in 5.4.1p4, 5.4.2p1, 5.5.2f1 and 5.5.2p2

    The editor log stacktrace is

    Code (CSharp):
    1. ========== OUTPUTING STACK TRACE ==================
    2.  
    3. 0x0000000141ED8C96 (Unity) physx::shdfnd::Time::getCurrentTimeInTensOfNanoSeconds
    4. 0x0000000141ED92C8 (Unity) physx::shdfnd::Time::getCurrentTimeInTensOfNanoSeconds
    5. 0x0000000141ED79BB (Unity) physx::shdfnd::Time::getCurrentTimeInTensOfNanoSeconds
    6. 0x0000000141DE4E02 (Unity) physx::shdfnd::atomicMax
    7. 0x00000001408FE3CE (Unity) physx::shdfnd::Foundation::getErrorHandler
    8. 0x0000000140B8CFFF (Unity) physx::shdfnd::ErrorHandler::getMaxCallbackNum
    9. 0x0000000140B8D239 (Unity) physx::shdfnd::ErrorHandler::getMaxCallbackNum
    10. 0x0000000140B8D3D8 (Unity) physx::shdfnd::ErrorHandler::getMaxCallbackNum
    11. 0x0000000140B8D4CB (Unity) physx::shdfnd::ErrorHandler::getMaxCallbackNum
    12. 0x0000000140F930BC (Unity) physx::shdfnd::ErrorHandler::getMaxCallbackNum
    13. 0x00007FFC3C4F8364 (KERNEL32) BaseThreadInitThunk
    14. 0x00007FFC3CD070D1 (ntdll) RtlUserThreadStart
    15.  
    16. ========== END OF STACKTRACE ===========
    It appears to be worse in 5.5, as this issue only appeared once in a while in 5.4 (usually when exiting playmode), but now under 5.5 appears a few seconds after scene load.
     
    neonusso likes this.
  25. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,132
    Hi Mark,
    Thanks for your help! Could you please file a bug report with the stacktrace attached?
     
  26. yant

    yant

    Unity Technologies

    Joined:
    Jul 24, 2013
    Posts:
    595
    To update you on the physics crashes that got reported recently:

    * PxsBroadphaseContextSap crash (case 878740) is fixed. It's going to be available to 2017.1 alpha testers around next week; 5.6 is going to receive the fix in one of the very first patches after the public release, 5.5 reports are rare for some reason, but I believe it still makes sense to deliver a back-port of the fix to 5.5 right after 5.6.

    * PhysX::shdfnd::Array<...>::Resize crash is being investigated as we speak, upvote here: https://issuetracker.unity3d.com/is...t-resize-crash-when-meshcollider-convex-is-on

    * @Mark_Darkrift -- I've checked our crashes database and can see no reports that look similar. I second @LeonhardP on filing a repro.

    Hope that helps, Anthony.