I need suggestions on how to debug an editor crash, please.
I have an intensive simulation running through Unity, and after about a couple minutes running in the editor, the Unity Editor just vanishes. It doesn’t give me a crash dialog. It doesn’t write anything to the logs. It’s just like the process was killed. But I need to figure out how to fix this.
My project is 9GB and proprietary, so I can’t upload it. At first, I thought it was RAM, but this happens when usage never breaks 1.5GB. I’m using a slightly older version of Unity: 2019.2.6f1. I have the profiler turned off.
The simulation was built progressively, and only now reached the point where it’s stable enough to run for extended periods of time… so I can’t regression-test until a working point either.
And apparently Unity Answers doesn’t work anymore and the Premium support website is broken and the general support is taking 2+ weeks to answer, so I don’t really have anywhere else to turn to, as Unity continues to let its infrastructure crumble…
If anyone has any ideas about how I can get any information about how to find the source of the problem so I can address it, I’d very much appreciate the advice.
That’s theoretically possible… It mostly uses loops, but there are a few recursive bits. I’ll have to add some tracing, see if I can catch it. Thanks for the lead.
But on that note… Unity really still can’t spit out stack overflow error messages? That’s insane, and kind of pathetic.
Every runtime check has a nonzero performance cost, in this case one that will be paid at every function call and stack frame adjustment. Most games don’t need recursion.
Perhaps they reasoned that if the typical game blows out the stack, it had a serious problem and you were going south fast anyway.
To understand recursion, you must first understand recursion.
You could use that same logic for Null Reference Exceptions and divide by zero errors, but at least with those, Unity lets you know there is a problem when those happen and what it is and even where it is.
I understand recursion just fine… I’m just used to seeing a stack overflow exception pop up when it gets out of control, not a void where my editor just was.
I’m not expecting Unity to not crash. It can crash if it needs to. I just expect it to somehow give me a reason for why so I can fix the problem and prevent future crashes. This silent crashing thing is not helpful at all.
That’s odd. I have made the same mistake numerous times before (thingy != null instead of _thingy != null in a getter) and I just get stack overflow exceptions.
This was indeed the problem. Once I refactored to a queued while loop, the crash disappeared and I just got an occasional brief hang when calculations got intense, as expected. Thanks for pointing me in the right direction.
I was also experiencing Unity crashing without any helpful logs, but the windows 10 EventViewer did show
Exception code: 0xc0000005 in the mono-2.0-bdwgc.dll module, and Google results mislead me to issues associated with graphics cards.
Recursion (a bug) was causing the crashes, and luckily Unity was eventually (after a few restarts) able to catch and log the exception in the console. StackOverflowException. Here’s the nasty little bug that would’ve been very difficult to find (note that DeploymentStatus should be returned and not deploymentStatus, as that causing the infinite recursion) :
protected I5Keys.DeploymentStatus DeploymentStatus = I5Keys.DeploymentStatus.Operational;
public I5Keys.DeploymentStatus deploymentStatus { get { return deploymentStatus; } }
How did you get to have Unity to catch something ? It is full silent in my case. Already tried anyting I could (logging/breakpoints). The unity thread crashes after a yield return null of my coroutines and I get no message nowhere in the logs. I get the windows event that look like yours though. https://discussions.unity.com/t/947030
Thanks for your heads up.