Winodws Standalone Crash at Close

I’m having a problem where our application seems to crash when closed (I attached a picture of the crash). It seems to be related to a native C++ dll that we’re loading (CEF). The error log shows the file crash trace:

Stack Trace

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

ERROR: SymGetSymFromAddr64, GetLastError: ‘The specified module could not be found.’ (Address: 10A80CD0)
ERROR: SymGetModuleInfo64, GetLastError: ‘A dynamic link library (DLL) initialization routine failed.’ (Address: 10A80CD0)
0x10A80CD0 (())
0x1282E581 (libcef) cef_string_map_value
ERROR: SymGetSymFromAddr64, GetLastError: ‘The specified module could not be found.’ (Address: 0508FCC8)
ERROR: SymGetModuleInfo64, GetLastError: ‘A dynamic link library (DLL) initialization routine failed.’ (Address: 0508FCC8)
0x0508FCC8 (())
ERROR: SymGetSymFromAddr64, GetLastError: ‘The specified module could not be found.’ (Address: 050E8735)
ERROR: SymGetModuleInfo64, GetLastError: ‘A dynamic link library (DLL) initialization routine failed.’ (Address: 050E8735)
0x050E8735 (())
ERROR: SymGetSymFromAddr64, GetLastError: ‘The specified module could not be found.’ (Address: 050E8675)
ERROR: SymGetModuleInfo64, GetLastError: ‘A dynamic link library (DLL) initialization routine failed.’ (Address: 050E8675)
0x050E8675 (())
ERROR: SymGetSymFromAddr64, GetLastError: ‘The specified module could not be found.’ (Address: 050E8626)
ERROR: SymGetModuleInfo64, GetLastError: ‘A dynamic link library (DLL) initialization routine failed.’ (Address: 050E8626)
0x050E8626 (())
ERROR: SymGetSymFromAddr64, GetLastError: ‘The specified module could not be found.’ (Address: 05071CC7)
ERROR: SymGetModuleInfo64, GetLastError: ‘A dynamic link library (DLL) initialization routine failed.’ (Address: 05071CC7)
0x05071CC7 (())
0x1002B6F3 (mono) mono_gc_is_finalizer_thread
0x1002B8A9 (mono) mono_gc_is_finalizer_thread
0x1002B978 (mono) mono_gc_is_finalizer_thread
0x1010C38E (mono) unity_mono_method_is_generic
0x772338F4 (KERNEL32) BaseThreadInitThunk
0x77655DE3 (ntdll) RtlUnicodeStringToInteger

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

Looking at the error.log yields the following:

error.log

Unity Player [version: Unity 5.3.4f1_fdbb5133b820]

Unknown caused an Access Violation (0xc0000005)
in module Unknown at 0023:10a80cd0.

Error occurred at 2016-05-03_173636.
C:\app\Demo.exe
46% memory in use.
0 MB physical memory [0 MB free].
0 MB paging file [0 MB free].
0 MB user address space [3586 MB free].
Write to location 00ce53d0 caused an access violation.

Is this type of error systematic of something? CEF does run on another thread and I shut that down on the application quit. I cancel the quit in OnApplicationQuit and wait 5 seconds after the thread and CEF shutdown and I still get the crash.

Thanks for the help!

2621083--184040--crash.png

Do you have the source code for that dll?
If you have Visual Studio, you can try attaching debugger to game, that might help pinpointing the crash.

In case anyone else is having a similar issue, I was able to solve this. Turns out it was a garbage collection issue with one of the C++ wrappers in the library. I had the debug symbols for the dll (pdb) and hooked that up to Visual Studio and found where it was crashing. I already had assumed it was a garbage collection issue from the “mono_gc_is_finalizer_thread” in the error trace, so the debug symbols lead me to the dispose of a class that was getting collected at the wrong time.