digitalmars.D.learn - Printing stacktrace on segfault
- simendsjo (1/1) Mar 27 2012 Is there a way to print a stacktrace on segfaults on linux?
- David (3/4) Mar 27 2012 I haven't found one, but you can use gdb, the only thing you've to do is...
- simendsjo (2/6) Mar 29 2012 Thanks. Using only -g seems to work just fine on gdb 7.3
- Jonathan M Davis (7/8) Mar 27 2012 You can do it if you install a signal handler for sigsegv and use
- =?UTF-8?B?IkrDqXLDtG1lIE0uIEJlcmdlciI=?= (8/9) Mar 27 2012 catchsegv (part of glibc, so should be available on just about all
Is there a way to print a stacktrace on segfaults on linux?
Mar 27 2012
Am 27.03.2012 12:04, schrieb simendsjo:Is there a way to print a stacktrace on segfaults on linux?I haven't found one, but you can use gdb, the only thing you've to do is to compile with -g and -gc (or you use gdc)
Mar 27 2012
On Tue, 27 Mar 2012 16:30:01 +0200, David <d dav1d.de> wrote:Am 27.03.2012 12:04, schrieb simendsjo:Thanks. Using only -g seems to work just fine on gdb 7.3Is there a way to print a stacktrace on segfaults on linux?I haven't found one, but you can use gdb, the only thing you've to do is to compile with -g and -gc (or you use gdc)
Mar 29 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
Mar 27 2012
simendsjo wrote:Is there a way to print a stacktrace on segfaults on linux?catchsegv (part of glibc, so should be available on just about all Linux distros...) Jerome --=20 mailto:jeberger free.fr http://jeberger.free.fr Jabber: jeberger jabber.fr
Mar 27 2012