Crash loading scene

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:

This callstack appears also here U5.3 - ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' - Unity Engine - Unity Discussions but there is no solution for it.

Any idea?

(We are using 5.6.1p2)

Hey NachoAbril

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.

From error.log when it crashes:

49% memory in use.
16305 MB physical memory [8170 MB free].
18737 MB paging file [5838 MB free].
134217728 MB user address space [134214744 MB free].
Read from location 00016ffc caused an access violation.

Hi,
We are experiencing the exact same issue in our game (Please find attached the crash log folder with the callstack).

========== OUTPUTING STACK TRACE ==================

0x00007FF6D60D8D69 (Expeditions Viking) [f:\dd\vctools\crt_bld\SELF_64_amd64\crt\src\amd64\memcpy.asm:381] memcpy
0x00007FF6D5A46F0C (Expeditions Viking) [c:\buildslave\unity\build\runtime\serialize\serializationcaching\memorycacherreadblocks.cpp:23] ReadFileCache
0x00007FF6D5B4384D (Expeditions Viking) [c:\buildslave\unity\build\runtime\serialize\serializedfile.cpp:697] SerializedFile::ReadHeader
0x00007FF6D5B43A1D (Expeditions Viking) [c:\buildslave\unity\build\runtime\serialize\serializedfile.cpp:401] SerializedFile::InitializeRead
0x00007FF6D5B3A0C8 (Expeditions Viking) [c:\buildslave\unity\build\runtime\serialize\persistentmanager.cpp:2063] PersistentManager::GetStreamNameSpaceInternal
0x00007FF6D5B3BE83 (Expeditions Viking) [c:\buildslave\unity\build\runtime\serialize\persistentmanager.cpp:276] PersistentManager::GetLoadErrorMessageFromPath
0x00007FF6D5A40A9F (Expeditions Viking) [c:\buildslave\unity\build\runtime\preloadmanager\loadsceneoperation.cpp:107] LoadSceneOperation::Perform
0x00007FF6D5A4208D (Expeditions Viking) [c:\buildslave\unity\build\runtime\preloadmanager\preloadmanager.cpp:368] PreloadManager::Run
0x00007FF6D5A42139 (Expeditions Viking) [c:\buildslave\unity\build\runtime\preloadmanager\preloadmanager.cpp:204] PreloadManager::Run
0x00007FF6D5A9BFA8 (Expeditions Viking) [c:\buildslave\unity\build\runtime\threads\thread.cpp:38] Thread::RunThreadWrapper
0x00007FFB8BB02774 (KERNEL32) BaseThreadInitThunk
0x00007FFB8C0C0D51 (ntdll) RtlUserThreadStart

========== END OF STACKTRACE ===========

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:

Thanks in advance.

3187114–243238–crash log files.7z (30.7 KB)

1 Like

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.

I just changed the positions of the scenes in the build settings and voila! Thank you for the tip!