Can you get any program in Linux to print a stack trace if it segfaults?

Posted by Neil on Server Fault See other posts from Server Fault or by Neil
Published on 2009-09-02T19:09:00Z Indexed on 2011/02/22 23:27 UTC
Read the original article Hit count: 255

Filed under:
|

If I run a program from the shell, and it segfaults:

$ buggy_program
Segmentation fault

It will tell me, however, is there a way to get programs to print a backtrace, perhaps by running something like this:

$ print_backtrace_if_segfault buggy_program
Segfault in main.c:35
(rest of the backtrace)

I'd also rather not use strace or ltrace for that kind of information, as they'll print either way...

© Server Fault or respective owner

Related posts about linux

Related posts about segfault