How to open Windows crash dumps?
-
I have set up Windows to automatically produce a crash dump when an application crashes according to this guide https://www.meziantou.net/tip-automatically-create-a-crash-dump-file-on-error.htm
Now my Qt application (debug build) has crashed and i have a .dmp file.
But when i try to load it into QtCreator using "Start Debugging -> Load Core File", it says the file format is not recognized. I have noticed this ticket https://bugreports.qt.io/browse/QTCREATORBUG-8834 but it says it has been resolved in 2015, while my QtCreator was built in 2020.What am i doing wrong?
-
@Youda008
While you await a better answer. I don't use Windows. But under Linux at least "Load Core File" would be for a Linuxcore
dump file. Do you have any evidence that Creator (the debugger) under Windows would accept a.dmp
file for anything like this? My thought is it would not, they are likely completely different things.It also depends on what compiler and what debugger you use under Windows, which you don't say.
The usual way is to run your program from Creator and wait for it to "crash". Then you will be able to investigate. If you have to only produce some external file from your program not running inside Creator under Windows then I suspect it may be "complicated" to get anything from that in Creator debugging. You might search the web for what you can do with Windows
.dmp
file to analyze it.EDIT
LOL, per @Chris-Kawa below looks like I am quite wrong and.dmp
files are acceptable core files under Windows. Sorry! I never knew this when used to develop for Windows... -
@Youda008 Is your app compiled using MinGW or MSVC compiler? Which version? Do you have a compatible kit selected (same Qt and compiler) when using Load Core File?
Can you check if the dump file is valid (e.g. I've seen sometimes 0 size dmp files generated for some reason) and does it open in Visual Studio to see if that's a QtCreator issue or a file issue?@JonB .dmp is the standard format for crash dumps on Windows. QtCreator supports them.
-
My toolchain is: mingw-w64-x86_64-gcc 13.1.0-7
The dump file seems to be valid, it opens in Visual Studio correctly, but of course there are no symbols (only addresses in stack trace), because the symbols in the executable are not in the Microsoft pdb format.
This crash is happening to a customer and is not reproducible on my machine, so i cannot debug it locally on a running application. And i don't think i can convince him to install the full development suite on his computer. Crash dump is all i can ask him.
-
@Youda008 I don't have a MinGW setup to try it, but it works ok with MSVC compiled app. Maybe QtCreator can't handle a dump from MinGW or there's something wrong with your debugger setup. I don't know, sorry.
As a stopgap solution you might use a tool like cv2pdb to extract pdb from the debug executable and maybe you'll be able to diagnose this crash in Visual Studio.
-
According to https://stackoverflow.com/questions/5225579/crash-reporting-for-mingw-applications answered 12 years ago, it's up to your application to handle a crash when using MinGW.
This is due to Windows being Windows and supporting only their own stuff.
https://stackoverflow.com/questions/5814568/is-there-a-way-to-generate-a-gdb-readable-coredump-when-running-programs-compile provides also some information.
Maybe DrMingw can be of help, but I think the best way would be for your application to handle the crash.
-
@Chris-Kawa Tried that too, but it produced a PDB the VisualStudio couldn't load. See https://github.com/rainers/cv2pdb/issues/89