[PATCH] Use external tool for creating backtraces on crashes if available.

Alan Coopersmith alan.coopersmith at oracle.com
Mon Oct 11 10:53:23 PDT 2010


Matthias Hopf wrote:
> On Oct 08, 10 13:43:38 -0700, Alan Coopersmith wrote:
>> Matthias Hopf wrote:
>>> This calls /usr/bin/xorg-backtrace to create reasonable commented backtraces
>>> with gdb. On errors it falls back to the generic method.
>> There's already similar code in the backtrace.c file in the
>> # ifdef HAVE_PSTACK case, where we fork the external pstack
>> process on Solaris to get stack traces that have more information
>> than the libc builtins allow, like getting full symbol tables from
>> libelf.
>>
>> Could we make the fork/exec wrapper common between the two?   I'd
>> even be okay with making the entire code in backtrace.c common and
>> just letting the script handle calling gdb or pstack.   (Solaris
>> systems are more likely to have pstack installed than gdb.)
> 
> I'll take a look at it.
> What do you think - would it make sense to call gdb on solaris if it is
> installed, or always pstack?

gdb or dbx would provide source information when compiled with -g, while
I don't think pstack will, but pstack will be faster and have less
dependencies/complexity on startup - but given that you're already execing
a script, I guess that's not a big deal (and hopefully we're not crashing
often enough to benchmark it).

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list