Printing stacktrace on segfault

Jonathan M Davis jmdavisProg at gmx.com
Tue Mar 27 09:09:53 PDT 2012


On Tuesday, March 27, 2012 12:04:59 simendsjo wrote:
> Is there a way to print a stacktrace on segfaults on linux?

You can do it if you install a signal handler for sigsegv and use 
backtrace_symbols to construct a stacktrace. Or you can just run the program 
in gdb or turn core dumps on and use gdb to inspect the core dump. But the 
first solution won't require you to rerun the program or always run with core 
dumps enabled. It _is_ more work though, if you've never done it.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list