Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

printing stack trace for windows coredump without needing to enter windbg/visual studio interactively

I would like to get a stack trace of thread which is causing the crash by invoking predefined commands written in a script, so that I run script and I get a log file containing the back trace of all threads. I can then parse this log file to see if there is known issue.

like image 353
user1527651 Avatar asked Dec 12 '22 04:12

user1527651


1 Answers

I'd recommend you take a look a cdb. It's a pretty full-featured commandline version of windbg and should already be installed with windbg.

You could tell it to open the dump, print the stack traces and exit with the command line:

cdb -z yourdump.dmp -c "~*kv; q"

Or you could even get fancy and do some automated analysis with:

cdb -z yourdump.dmp -c "!analyze -v; q"

This probably makes more sense since it will try to recover the stack at the time a second chance exception was thrown, where just printing the stacks with k would miss the issue entirely. You could also make use of the FAILURE_BUCKET_ID it outputs to do most of the categorization for you.

From there, it is a just a matter of using before the command you wish to execute .logopen or redirecting the commandline output to a file.

like image 125
Sean Cline Avatar answered May 12 '23 06:05

Sean Cline