What actions do I need to take to get a crash dump in ALL error scenarios?
13:03 27 Nov 2012

We're on Windows and we want to get a crash dump (possibly using MiniDumpWriteDump) for all scenarios where our application exit's unexpectedly.

So far we have identified, and set up, the following:

  • SetUnhandledExceptionFilter for unhandled exception (Win32 as well as "normal" C++ ones.)
  • _set_invalid_parameter_handler for the CRT invalid argument handling
  • _set_abort_behaviorplus a SIGABRT handler to account for calls to abort()

Is there anything we missed? (Modulo some code non-legitimately calling ExitProcess, TerminateProcess or one of the exit variants.)


I'll note that this question here is orthogonal to how a crash dump is then obtained. E.g., if you want a crash dump in case of abort, you always must use _set_abort_behaviour because otherwise abort just exits.

I'll also note that on Windows7+, not setting SetUHEF and just setting up the "correct" WER dump settings in the registry is often a viable way.

c++ windows visual-c++ crash-dumps