Search Unity

Reading the error log

Discussion in 'Editor & General Support' started by Baasket, Jul 12, 2021.

  1. Baasket

    Baasket

    Joined:
    May 20, 2018
    Posts:
    26
    Hi everyone.

    For the past few weeks, I've encountered an issue... I need help understanding what goes wrong with a given project. When playing a build of that project, and only a build, the game ends up crashing after a while. This has never happened in the editor. There seems to be no clear pattern as to why it occurs. For that reason, I went and looked at the files generated as the game crashes. But understanding them has proved... quite a challenge.

    I've attached the generated files to this post (they are .log, but I switched to .txt so that the forum would allow uploading them).

    Line 3: UnityPlayer.dll caused an Access Violation (0xc0000005)

    and line 20: Write to location 00FFFFF0 caused an access violation.

    both suggest that there is some kind of segmentation fault. But the stack trace is not easy to read. I've tried using Visual Studio to parse the cash.dmp file with both https://symbolserver.unity3d.com/ and the .pdb files generated when building my project. However, even that has proved to be of little use (it spits out a rather cryptic "Unhandled exception at 0x795D2B6B (UnityPlayer.dll) in crash.dmp: 0xC0000005: Access violation writing location 0x00FFFFF0.") And I can't seem to find what's wrong with this project...

    Has anyone more experience with that? Help would be much appreciated...
     

    Attached Files:

  2. Baasket

    Baasket

    Joined:
    May 20, 2018
    Posts:
    26
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,736
    The first candidate might be some type of memory leak. Have you tried attaching the profiler and watching memory usage over the first so many minutes of play? The profiler is at Windows -> Analysis -> Profiler
     
    Baasket likes this.
  4. bobisgod234

    bobisgod234

    Joined:
    Nov 15, 2016
    Posts:
    1,042
    Visual Studio should show you the assembly that caused the game to crash. Inspect CPU state (registers etc) and google some of the x64 instructions, and you might be able to make a guess what is causing it to crash.
     
    Baasket likes this.
  5. Baasket

    Baasket

    Joined:
    May 20, 2018
    Posts:
    26
    Thanks.

    That was also one of my first guesses. Using the profiler in the editor showed nothing that seemed responsible for the issue (but it was a good opportunity the optimize other aspects of the code).

    On builds, Windows performance monitoring shows no spike in memory use, and the fact that the crash never happens in the editor hints, I think, at something else. But I'm still not sure what...

    I will, however, try using the profiler on the built version, and keep you updated. Thanks for the reply.
     
    Kurt-Dekker likes this.
  6. Baasket

    Baasket

    Joined:
    May 20, 2018
    Posts:
    26
    So, after trying it, the profiler revealed no memory leak when running with a built version. Error messages show up in the console, but it seems to be a known issue with the profiler.

    I wonder if the game could be unhappy with having more than one camera (this is a split screen game) rendering the terrain details. I think the crashes happen only when "detail heavy" scenes are on screen...

    Anyway, thanks again for the suggestion.
     

    Attached Files:

  7. Baasket

    Baasket

    Joined:
    May 20, 2018
    Posts:
    26
    Thanks for the suggestion. I have to say, that this stretches somewhat beyond what I'm proficient at, but if the registers you are referring to are the whole EDI, ESI, EAX, EBX bunch, I tried looking them up.

    From a couple of error logs I did read, all seem to involve an access violation at the same address:

    line 3: UnityPlayer.dll caused an Access Violation (0xc0000005)

    And there are two categories of errors afterwards. The first one is :

    line 20: Write to location 00000000 caused an access violation.

    In which registers EDI and EDX store a value of 0x00000000. Then the second type (more frequent) is:

    line 20: Write to location 00FFFFF0 caused an access violation.

    Where the ECX register stores a value of 0x00fffff0.

    I found this page, explaining what they are for, but I must say that I still have no clue where the issue comes from.
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Is there a callstack you can share?
     
  9. Baasket

    Baasket

    Joined:
    May 20, 2018
    Posts:
    26
    Well, from the error log (the full file is attached to my first post in this discussion, with all the many stack traces), the crashed thread is:

    Stack Trace of Crashed Thread 33148:
    0x795D2B6B (UnityPlayer) DynamicHeapAllocator::Allocate
    0x795CAF85 (UnityPlayer) DualThreadAllocator<DynamicHeapAllocator>::Allocate
    0x795BA1F5 (UnityPlayer) MemoryManager::Allocate
    0x795C8C9F (UnityPlayer) malloc_internal
    0x798C89D0 (UnityPlayer) VertexData::AllocateMemory
    0x798D373D (UnityPlayer) VertexData::Resize
    0x79FC3DEA (UnityPlayer) DetailCombinedMeshGenerationJob
    0x79935656 (UnityPlayer) JobQueue::Exec
    0x79936874 (UnityPlayer) JobQueue::processJobs
    0x7993AD92 (UnityPlayer) JobQueue::WorkLoop
    0x79C2F35A (UnityPlayer) Thread::RunThreadWrapper
    0x7706FA29 (KERNEL32) BaseThreadInitThunk
    0x77947A7E (ntdll) RtlGetAppContainerNamedObjectPath
    0x77947A4E (ntdll) RtlGetAppContainerNamedObjectPath
    And the second one is filled with error messages too:

    Call Stack for Thread 16920:
    0x779529DC (ntdll) NtWaitForSingleObject
    0x7A6F23B0 (UnityPlayer) UnityClassic::Baselib_SystemSemaphore_Acquire
    0x7993AC96 (UnityPlayer) JobQueue::WaitForJobGroupID
    0x7992E89B (UnityPlayer) CompleteFenceInternal
    0x79931AE5 (UnityPlayer) SyncFences
    0x79FB459C (UnityPlayer) DetailRenderer::Render
    0x79FAFFF5 (UnityPlayer) TerrainManager::CullAllTerrains
    0x79922C25 (UnityPlayer) CullScriptable
    0x79DF5DF1 (UnityPlayer) ScriptableRenderContext_CUSTOM_Internal_Cull_Injected
    ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 1F5EE5E0)
    ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 1F5EE5E0)
    0x1F5EE5E0 ((<unknown>)) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 1F5EE580)
    ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 1F5EE580)
    0x1F5EE580 ((<unknown>)) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 1F5EE534)
    ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 1F5EE534)
    0x1F5EE534 ((<unknown>)) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 1F5EC674)
    ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 1F5EC674)
    0x1F5EC674 ((<unknown>)) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 1F279FE4)
    ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 1F279FE4)
    0x1F279FE4 ((<unknown>)) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 1F276C64)
    ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 1F276C64)
    0x1F276C64 ((<unknown>)) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 1F276653)
    ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 1F276653)
    0x1F276653 ((<unknown>)) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 1F22776C)
    ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 1F22776C)
    0x1F22776C ((<unknown>)) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 1F22787A)
    ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 1F22787A)
    0x1F22787A ((<unknown>)) (function-name not available)
    0x78B22B3E (mono-2.0-bdwgc) mono_get_runtime_build_info
    0x78AB94A7 (mono-2.0-bdwgc) mono_perfcounters_init
    0x78AC0136 (mono-2.0-bdwgc) mono_runtime_invoke
    0x79D1495F (UnityPlayer) scripting_method_invoke
    0x79D119DA (UnityPlayer) ScriptingInvocation::Invoke
    0x79916D28 (UnityPlayer) ScriptableRenderContext::ExtractAndExecuteRenderPipeline
    0x79673358 (UnityPlayer) RenderManager::RenderCamerasWithScriptableRenderLoop
    0x79672CC9 (UnityPlayer) RenderManager::RenderCameras
    0x799FD37A (UnityPlayer) PlayerRender
    0x799FA26D (UnityPlayer) `InitPlayerLoopCallbacks'::`2'::postLateUpdateFinishFrameRenderingRegistrator::Forward
    0x799E92DC (UnityPlayer) ExecutePlayerLoop
    0x799EE574 (UnityPlayer) PlayerLoop
    0x7956156B (UnityPlayer) PerformMainLoop
    0x7955FDD5 (UnityPlayer) MainMessageLoop
    0x795645C6 (UnityPlayer) UnityMainImpl
    0x79565235 (UnityPlayer) UnityMain
    0x00101015 (Ananas) wWinMain
    0x001011D9 (Ananas) __scrt_common_main_seh
    0x7706FA29 (KERNEL32) BaseThreadInitThunk
    0x77947A7E (ntdll) RtlGetAppContainerNamedObjectPath
    0x77947A4E (ntdll) RtlGetAppContainerNamedObjectPath​
     
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Hmm interesting, it crashes while trying to allocate memory. That could point to some kind of memory corruption. Could you try running your game with "-debugallocator" flag and see if that changes where it crashes?
     
  11. Baasket

    Baasket

    Joined:
    May 20, 2018
    Posts:
    26
    Thanks for the help.
    I would certainly love to try that "-debugallocator". But how do you use that flag? Is that somewhere in the Project Settings?
     
  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    No, it's a command line parameter. Launch your game through the windows terminal and add "-debugallocator" arg to the end:

    Code (csharp):
    1. D:\Game>Game.exe -debugallocator
    Just make sure you use it on a development build of the game.
     
    Baasket likes this.
  13. Baasket

    Baasket

    Joined:
    May 20, 2018
    Posts:
    26
    Oh... I have never used it before. Well, with this flag, it crashed alright, just like before and here are the first two stack traces :

    Stack Trace of Crashed Thread 14052:
    0x57B32B6B (UnityPlayer) UnityMain
    0x57B2AF85 (UnityPlayer) UnityMain
    0x57B1A1F5 (UnityPlayer) UnityMain
    0x57B28C9F (UnityPlayer) UnityMain
    0x57E289D0 (UnityPlayer) UnityMain
    0x57E3373D (UnityPlayer) UnityMain
    0x58523DEA (UnityPlayer) UnityMain
    0x57E95656 (UnityPlayer) UnityMain
    0x57E96874 (UnityPlayer) UnityMain
    0x57E9AD92 (UnityPlayer) UnityMain
    0x5818F35A (UnityPlayer) UnityMain
    0x76CFFA29 (KERNEL32) BaseThreadInitThunk
    0x77727A9E (ntdll) RtlGetAppContainerNamedObjectPath
    0x77727A6E (ntdll) RtlGetAppContainerNamedObjectPath

    Stacks for Running Threads:

    Call Stack for Thread 11696:
    0x777329FC (ntdll) NtWaitForSingleObject
    0x58C523B0 (UnityPlayer) UnityMain
    0x57E9AC96 (UnityPlayer) UnityMain
    0x57E8E89B (UnityPlayer) UnityMain
    0x57E91AE5 (UnityPlayer) UnityMain
    0x5851459C (UnityPlayer) UnityMain
    0x5850FFF5 (UnityPlayer) UnityMain
    0x57E82C25 (UnityPlayer) UnityMain
    0x58355DF1 (UnityPlayer) UnityMain
    ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 1C5CE5E0)
    ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 1C5CE5E0)
    0x1C5CE5E0 ((<unknown>)) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 1C5CE580)
    ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 1C5CE580)
    0x1C5CE580 ((<unknown>)) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 1C5CE534)
    ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 1C5CE534)
    0x1C5CE534 ((<unknown>)) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 1C5CC674)
    ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 1C5CC674)
    0x1C5CC674 ((<unknown>)) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 1C629FE4)
    ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 1C629FE4)
    0x1C629FE4 ((<unknown>)) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 1C626C64)
    ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 1C626C64)
    0x1C626C64 ((<unknown>)) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 1C626653)
    ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 1C626653)
    0x1C626653 ((<unknown>)) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 1C61776C)
    ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 1C61776C)
    0x1C61776C ((<unknown>)) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 1C61787A)
    ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 1C61787A)
    0x1C61787A ((<unknown>)) (function-name not available)
    0x571F2B3E (mono-2.0-bdwgc) mono_get_runtime_build_info
    0x571894A7 (mono-2.0-bdwgc) mono_perfcounters_init
    0x57190136 (mono-2.0-bdwgc) mono_runtime_invoke
    0x5827495F (UnityPlayer) UnityMain
    0x582719DA (UnityPlayer) UnityMain
    0x57E76D28 (UnityPlayer) UnityMain
    0x57BD3358 (UnityPlayer) UnityMain
    0x57BD2CC9 (UnityPlayer) UnityMain
    0x57F5D37A (UnityPlayer) UnityMain
    0x57F5A26D (UnityPlayer) UnityMain
    0x57F492DC (UnityPlayer) UnityMain
    0x57F4E574 (UnityPlayer) UnityMain
    ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 57AC156B)
    0x57AC156B (UnityPlayer) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 57ABFDD5)
    0x57ABFDD5 (UnityPlayer) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 57AC45C6)
    0x57AC45C6 (UnityPlayer) (function-name not available)
    0x57AC5235 (UnityPlayer) UnityMain
    ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00F81015)
    0x00F81015 (Ananas) (function-name not available)
    ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00F811D9)
    0x00F811D9 (Ananas) (function-name not available)
    0x76CFFA29 (KERNEL32) BaseThreadInitThunk
    0x77727A9E (ntdll) RtlGetAppContainerNamedObjectPath
    0x77727A6E (ntdll) RtlGetAppContainerNamedObjectPath​

    And I have attached the error.log and the player.log, for all intents and purposes...
     

    Attached Files:

  14. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    That stack trace is busted. You should check the "Copy PDB Files" checkbox or it will not resolve correctly. Alternatively, you can open the .dmp file and see the real stacktrace inside (copy pdb files is not needed for that to work correctly).
     
    Baasket likes this.
  15. Baasket

    Baasket

    Joined:
    May 20, 2018
    Posts:
    26
    So here's a stack trace generated with the PDB files. I'm still confused as to what it all means, but its certainly is easier on the eye.

    Stack Trace of Crashed Thread 26296:
    0x7AB8CE8E (UnityPlayer) tlsf_add_pool
    0x79BC3392 (UnityPlayer) DynamicHeapAllocator::Allocate
    0x79BBB765 (UnityPlayer) DualThreadAllocator<DynamicHeapAllocator>::Allocate
    0x79BAA9B5 (UnityPlayer) MemoryManager::Allocate
    0x79BB947F (UnityPlayer) malloc_internal
    0x79EB9160 (UnityPlayer) VertexData::AllocateMemory
    0x79EC3ECD (UnityPlayer) VertexData::Resize
    0x7A5B482A (UnityPlayer) DetailCombinedMeshGenerationJob
    0x79F25DD6 (UnityPlayer) JobQueue::Exec
    0x79F2B237 (UnityPlayer) JobQueue::WaitForJobGroupID
    0x79F1F01B (UnityPlayer) CompleteFenceInternal
    0x79F22265 (UnityPlayer) SyncFences
    0x7A5A4FDC (UnityPlayer) DetailRenderer::Render
    0x7A5A0A35 (UnityPlayer) TerrainManager::CullAllTerrains
    0x79F133A5 (UnityPlayer) CullScriptable
    0x7A3E6901 (UnityPlayer) ScriptableRenderContext_CUSTOM_Internal_Cull_Injected
    0x1EF300A0 (UnityEngine.CoreModule) UnityEngine.Rendering.ScriptableRenderContext.Internal_Cull_Injected()
    0x1EBAFE98 (UnityEngine.CoreModule) UnityEngine.Rendering.ScriptableRenderContext.Internal_Cull()
    0x1EF1FF2C (UnityEngine.CoreModule) UnityEngine.Rendering.ScriptableRenderContext.Cull()
    0x1EF2C14C (Unity.RenderPipelines.Universal.Runtime) UnityEngine.Rendering.Universal.UniversalRenderPipeline.RenderSingleCamera()
    0x1EBA2C20 (Unity.RenderPipelines.Universal.Runtime) UnityEngine.Rendering.Universal.UniversalRenderPipeline.RenderCameraStack()
    0x1EB9C610 (Unity.RenderPipelines.Universal.Runtime) UnityEngine.Rendering.Universal.UniversalRenderPipeline.Render()
    0x1EB9BB72 (UnityEngine.CoreModule) UnityEngine.Rendering.RenderPipeline.InternalRender()
    0x1EB3BE94 (UnityEngine.CoreModule) UnityEngine.Rendering.RenderPipelineManager.DoRenderLoop_Internal()
    0x1EB3C128 (UnityEngine.CoreModule) <Module>.runtime_invoke_void_object_intptr_object()
    0x79262B9E (mono-2.0-bdwgc) mono_get_runtime_build_info
    0x791F9527 (mono-2.0-bdwgc) mono_perfcounters_init
    0x792001B6 (mono-2.0-bdwgc) mono_runtime_invoke
    0x7A30513F (UnityPlayer) scripting_method_invoke
    0x7A3021BA (UnityPlayer) ScriptingInvocation::Invoke
    0x79F074C0 (UnityPlayer) ScriptableRenderContext::ExtractAndExecuteRenderPipeline
    0x79C63B48 (UnityPlayer) RenderManager::RenderCamerasWithScriptableRenderLoop
    0x79C634B9 (UnityPlayer) RenderManager::RenderCameras
    0x79FEDADA (UnityPlayer) PlayerRender
    0x79FEA9DD (UnityPlayer) `InitPlayerLoopCallbacks'::`2'::postLateUpdateFinishFrameRenderingRegistrator::Forward
    0x79FD9A5C (UnityPlayer) ExecutePlayerLoop
    0x79FDECF4 (UnityPlayer) PlayerLoop
    0x79B51DCB (UnityPlayer) PerformMainLoop
    0x79B50635 (UnityPlayer) MainMessageLoop
    0x79B54E36 (UnityPlayer) UnityMainImpl
    0x79B55AA5 (UnityPlayer) UnityMain
    0x00B11015 (Ananas) wWinMain
    0x00B111D9 (Ananas) __scrt_common_main_seh
    0x769CFA29 (KERNEL32) BaseThreadInitThunk
    0x77CE7A7E (ntdll) RtlGetAppContainerNamedObjectPath
    0x77CE7A4E (ntdll) RtlGetAppContainerNamedObjectPath​
     

    Attached Files:

  16. Baasket

    Baasket

    Joined:
    May 20, 2018
    Posts:
    26
    As I wrote earlier, the game seems to crash mostly when a lot of details (I mean terrain details, grass) are present in the level. Since it's a split screen game, could it simply be that the terrain renderer has a finite amount of memory addresses ready for handling the details, but that having more than one camera causes some sort of "overflow"? If I reduce the detail density, I can't reproduce the crash as easily, if at all. In fact, the best fix I have found so far is to cut the detail density by 50%... does that make sense, or is it a pure coincidence?
     
  17. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Are you by any chance building a 32-bit build? I just noticed that. Could you try switching it to 64-bit?

    32-bit builds most definitely have very finite amount of memory addresses available and it's easy to run out.
     
    Telhurin and Baasket like this.
  18. Baasket

    Baasket

    Joined:
    May 20, 2018
    Posts:
    26
    You have got to be kidding me! I had not even seen that dropdown: luckily you paid attention. I think it could very well be it. I will keep you updated in a few days if no further crashes happen, but from the short few tests I was able to perform so far, it seems to be quite robust. Thank you very much for the help, and sorry that I missed such an obvious thing.
     
    Tautvydas-Zilys likes this.