9

I have an C++ application, that crashes on a computer of some person on the other end of the world. There's no way for me to simulate it or get the same computer. The person is no developer, so I cannot really ask him to install Visual Studio or something. I have pretty deep debug logs, but they didn't reveal anything usable.

Is there a tool, that could generate the stack trace of the application at the moment of the crash? Such thing is available inside OSX, but seems that Windows doesn't have it.

Vojtěch Melda Meluzín
  • 1,117
  • 3
  • 11
  • 22

4 Answers4

5

You can use procdump. It can be setup as a debugger to automatically create dumps for crashing processes.

Procdump is part of Sysinternal tools and can be found at:

http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx

Relevant switches:

Create a dump for a hung application:

Write a mini dump for a process named 'hang.exe' when one of it's Windows is unresponsive for more than 5 seconds:

C:\>procdump -h hang.exe hungwindow.dmp

Automatically create dumps for crashing apps:

Register as the Just-in-Time (AeDebug) debugger. Makes full dumps in c:\dumps.

C:\>procdump -ma -i c:\dumps

Create a dump for a pid:

 C:\>procdump <PID>

You can read the dump files using windbg: Getting started with dump file analysis

rogerdpack
  • 62,887
  • 36
  • 269
  • 388
Nasir
  • 10,935
  • 8
  • 31
  • 39
  • I tried on one computer and it works, but in a virtual machine, where no dev tools are installed it seems not working. Basically when executed it displays some terminal window with some text going through and then the window disappears, so I don't even have an idea what was there... – Vojtěch Melda Meluzín Jun 13 '14 at 16:41
2

Use google's lib that makes minidump for msvc to debug. CrashRpt

DarkWanderer
  • 8,739
  • 1
  • 25
  • 56
adnako
  • 1,287
  • 2
  • 20
  • 30
  • 2
    Just for clarity, this isn't "google's lib", it's just an open source project and it's now located at http://crashrpt.sourceforge.net/ – Perry Mar 20 '17 at 21:56
0

Since google seems to lead here for all "stack traces of windows" you can also get the stack trace of a running process using "sleepy" or "very sleepy" utilities.

another option: run it in gdb.exe, hit ctrl+c

rogerdpack
  • 62,887
  • 36
  • 269
  • 388
0

Your application can try to handle a crash itself and write out diagnostics. The keyword for that on Windows is "Structured Exception Handling": https://learn.microsoft.com/en-us/windows/win32/debug/structured-exception-handling

Your application can then capture a stack trace itself: https://learn.microsoft.com/en-us/windows/win32/api/dbghelp/nf-dbghelp-stackwalk

Or write a minidump.

user1387
  • 187
  • 10