Debugging crash during app exit (WPF)

0

I'm trying to figure out why an WPF-app won't exit imediately on closing it. Using Process Explorer I hade found out that WerFault.exe is started while exiting which seem to indicate that something crashes during the teardown, perhaps some destructor or dispose that fails. This started happening when I recently switched to VS2015. I am running Windows 8.

My question is: How can I find out what the real problem is? Any way of finding a crash log for WerFault.exe? I have hundreds of destructors and dispose-methods so it's a bit hard to put breakpoints in all of them. Any other way of capturing these kinds of errors in VS?

The exit code is -1073740791 which "indicate a bug in the executed software that causes stack overflow, leading to abnormal termination of the software". But where?

Some more info from the event log:

Faulting module name: ucrtbase.DLL, version: 10.0.10240.16390, time stamp: 0x55a5b718

Exception code: 0xc0000409

Fault offset: 0x0000000000065a4e

enter image description here

wpf
visual-studio-2015
visual-studio-debugging
asked on Stack Overflow Apr 22, 2016 by Andreas Zita • edited Apr 22, 2016 by Andreas Zita

1 Answer

0

You could try enabling user mode dumps:

  1. Create the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps
  2. Within LocalDumps, create a key that is the name of your executable
  3. Within the key you just created, set the values of DumpFolder, DumpCount, DumpType, and CustomDumpFlags as needed (you should definitely set DumpType to 2 for full dumps, otherwise I don't think that enough information will be captured to debug a managed dump).

Once you have done this, whenever your executable crashes a dump file will be created in the folder specified by DumpFolder (or %LOCALAPPDATA%\CrashDumps by default).

answered on Stack Overflow Apr 22, 2016 by Andy

User contributions licensed under CC BY-SA 3.0