We are experimenting a crash only in stand alone build. It happens loading a scene but not a specific one. Could be the first time the scene is loaded or any number later. Not always happens with the same build. With all this information, you can image how frustrating it is try to find a fix. This is the callstack:
One thing mentioned in the other thread is that it might be memory related. Based on your call stack the crash is in a location where memory is allocated in the engine, so it could be a similar problem. Have you looked at the memory usage of the application / free memory of the os when it crashes? Also have you submitted a fogbug report and project that we can look at by chance?
Hi Ryanc_unity,
Thanks for your message.
It crashes in a 16Gb machine (among others) and there is plenty of free memory when it crashes. I could send the project (it is very big) but maybe you never get the crash. If it was a consistent repro crash (for example always crashing loading scene X) I could think in a corrupted file, but sometimes we get the crash, you restart the game (same build) and follow the same steps and it doesn’t crash.
First we saw it in version 5.3.8 but it is still present after updating to 5.5.4.
After looking at the crashlog, the crash.dmp file in visual studio and debugging the code, it appears that the crash happens inside the functions SceneManager.LoadSceneAsync
or SceneManager.LoadScene (we tried both) when we call it to transition from one scene to another, in a windows build (64 bits) and it doesn’t happen always or in a consistent way.
We manage to provoke the crash kind of often in a specific computer at the office by making a build with all of our scenes and transitioning from one specific level (Level 1) to another one (Level 2).
These are the specs of that computer:
Processor Intel(R) Core™ i7-4770 CPU @ 3.40GHz, 3401 Mhz, 4 Core(s), 8 Logical Processor(s)
Installed Physical Memory (RAM) 16.0 GB
OS Name Microsoft Windows 10 Pro
NVIDIA GeForce GTX 760
If we move the scene that we are loading (Level 2) to a position in the BuildSettings just below the previous one (Level 2 goes from a build index 74 to a build index 11. Level 1 has index 10.), then the crash doesn’t seem to happen. That is of course not a solution but maybe it helps figuring out what is happening internally in Unity to provoke this crash while loading a scene.
We have tried removing all game objects in the scene, unloading all assets, calling Caching.CleanCache() and Resources.UnloadUnusedAssets before calling SceneManager.LoadSceneAsync (or SceneManager.LoadScene) just in case there is some memory issue, but still it crashed again after several attemps.
We are not sure what else we can try as a workaround or if there is any solution or we are missing something since the crash is quite random and it is still affecting our customers.
It seems that more games are affected from that bug:
Got same issue with exactly same stack trace. Deleting Library folder and reimporting whole project seems to help. I had unity crash not long before this bug appeared, maybe that was the cause.