Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need stack trace, but Cygwin won't even print core dump

I have a program which I run in Cygwin on Windows 7 and that always results in a segmentation fault. It is not my program, but I want help on it and the developer asked me for at least a stack trace My Cygwin variable looks like this: error_start=c:/cygwin/bin/dumper.exe. I also run this command before executing the program: ulimit -c unlimited. Those are the only two requirements I can find via google (including this question) to getting some sort of information from Cygwin after a segmentation fault.

But still, when I run the program, it prints the message Segmentation fault, and prints no a.exe.stackdump, nor any other dump file, neither does it start up the dumper utility. Any suggestions on how to get the needed information?

like image 677
Nate Glenn Avatar asked Jun 11 '12 15:06

Nate Glenn


1 Answers

Unlike on Unix, core dumps aren't "free" on Windows; even when you can get them, making use of them isn't as easy as on Unix. Cygwin doesn't fix these fundamental platform differences. The simple fact is that debugging took a different path on Windows: IDEs, interactive debuggers, and such. I wouldn't continue trying to pound that square peg into the round hole you're familiar with.

Short of installing Visual Studio and running the program under its debugger, the easiest way to get something useful is probably to install WinDbg, run your program under it, then say !heap -p -a UserAddr when it crashes. The stack backtrace should be in the output somewhere.

like image 150
Warren Young Avatar answered Oct 24 '22 10:10

Warren Young