Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Crash loading scene

Discussion in 'Windows' started by NachoAbril, Jul 13, 2017.

  1. NachoAbril

    NachoAbril

    Joined:
    Jun 30, 2014
    Posts:
    34
    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 https://forum.unity3d.com/threads/u...o-access-invalid-address.413565/#post-2696292 but there is no solution for it.

    Any idea?

    (We are using 5.6.1p2)
     
  2. Ryanc_unity

    Ryanc_unity

    Unity Technologies

    Joined:
    Jul 22, 2015
    Posts:
    332
    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?
     
  3. NachoAbril

    NachoAbril

    Joined:
    Jun 30, 2014
    Posts:
    34
    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.
     
  4. NachoAbril

    NachoAbril

    Joined:
    Jun 30, 2014
    Posts:
    34
    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.
     
  5. Logic-Artists

    Logic-Artists

    Joined:
    Feb 15, 2013
    Posts:
    4
    Hi,
    We are experiencing the exact same issue in our game (Please find attached the crash log folder with the callstack).
    Code (CSharp):
    1. ========== OUTPUTING STACK TRACE ==================
    2.  
    3. 0x00007FF6D60D8D69 (Expeditions Viking) [f:\dd\vctools\crt_bld\SELF_64_amd64\crt\src\amd64\memcpy.asm:381] memcpy
    4. 0x00007FF6D5A46F0C (Expeditions Viking) [c:\buildslave\unity\build\runtime\serialize\serializationcaching\memorycacherreadblocks.cpp:23] ReadFileCache
    5. 0x00007FF6D5B4384D (Expeditions Viking) [c:\buildslave\unity\build\runtime\serialize\serializedfile.cpp:697] SerializedFile::ReadHeader
    6. 0x00007FF6D5B43A1D (Expeditions Viking) [c:\buildslave\unity\build\runtime\serialize\serializedfile.cpp:401] SerializedFile::InitializeRead
    7. 0x00007FF6D5B3A0C8 (Expeditions Viking) [c:\buildslave\unity\build\runtime\serialize\persistentmanager.cpp:2063] PersistentManager::GetStreamNameSpaceInternal
    8. 0x00007FF6D5B3BE83 (Expeditions Viking) [c:\buildslave\unity\build\runtime\serialize\persistentmanager.cpp:276] PersistentManager::GetLoadErrorMessageFromPath
    9. 0x00007FF6D5A40A9F (Expeditions Viking) [c:\buildslave\unity\build\runtime\preloadmanager\loadsceneoperation.cpp:107] LoadSceneOperation::Perform
    10. 0x00007FF6D5A4208D (Expeditions Viking) [c:\buildslave\unity\build\runtime\preloadmanager\preloadmanager.cpp:368] PreloadManager::Run
    11. 0x00007FF6D5A42139 (Expeditions Viking) [c:\buildslave\unity\build\runtime\preloadmanager\preloadmanager.cpp:204] PreloadManager::Run
    12. 0x00007FF6D5A9BFA8 (Expeditions Viking) [c:\buildslave\unity\build\runtime\threads\thread.cpp:38] Thread::RunThreadWrapper
    13. 0x00007FFB8BB02774 (KERNEL32) BaseThreadInitThunk
    14. 0x00007FFB8C0C0D51 (ntdll) RtlUserThreadStart
    15.  
    16. ========== 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(TM) 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:
    https://forum.unity3d.com/threads/u...ror-attempt-to-access-invalid-address.413565/



    Thanks in advance.
     

    Attached Files:

    thinkcode likes this.
  6. Alex_lemminG

    Alex_lemminG

    Joined:
    Sep 11, 2015
    Posts:
    4
    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.
     
  7. thinkcode

    thinkcode

    Joined:
    Mar 25, 2016
    Posts:
    1
    I just changed the positions of the scenes in the build settings and voila! Thank you for the tip!