Search code examples
c++windowsvisual-studio-2010windows-7crash-dumps

Program crash - how to read appcompat.txt?


After the program I am debugging crashes, I am left with heap dump *.mdmp file & appcompat.txt in my Temp directory. I understand that appcompat.txt is an error report. Is there a description of its format?

My appcompat.txt lists a number of DLLs. Am I correct assuming that the reason for a crash could have only come from one of the listed DLLs? Can I limit my debugging effort to the DLLs listed in appcompat.txt?

Thanks in advance!


Solution

  • The minidump file is far more informative for diagnosing crashes:

    • Install Debugging Tools for Windows, if you don't already have it.
    • Set up the symbol path variable _NT_SYMBOL_PATH to point to the Microsoft symbol server
    • Run Windbg and do File -> Open Crash Dump and locate your .dmp or .mdmp file
    • Type !analyze -v.

    This will try to isolate the location of the crash. Note that just because a crash occurs in a particular dll it doesn't mean that is where the bug resides - it could be because an invalid parameter has been passed in from your application code. The analysis should hopefully show you a meaningful stack and an error code which should help in working out the actual cause of the crash.