Scott
Scott

Reputation: 5263

How do I have my program's core dump saved to a file upon a crash?

I'm using Bash. I used ulimit -c unlimited but the program still doesn't generate a core file. It may be due to the GUI debugger kicking in. I get the option to save the crash info to a file, but I really want a core file.

Edit: I just wrote a small non-gui program meant to crash, and it produced a core dump.

Upvotes: 1

Views: 1559

Answers (1)

stsquad
stsquad

Reputation: 6022

The simplest way is to run your app from the command line within gdb:

gdb --args /path/to/program with args

I assume the program that's causing you problems is Bug Buddy? You can always remove it or tweak your program to reset the default SIGSEGV handle to SIG_DFL after the GTK start-up to ensure the OS catches the signal and not any magic handling by the GUI libraries.

Upvotes: 3

Related Questions