[PATCH] Create reasonable backtraces via gdb automatically

Daniel Stone daniel at fooishbar.org
Tue Oct 19 09:14:31 PDT 2010


Hi,

On Fri, Oct 08, 2010 at 06:25:11PM +0200, Matthias Hopf wrote:
> The following is a patch for the xserver that makes Xorg's stack traces
> *tremendously* more useful - by providing exact source location
> including source snippets (if -debug{source,info} rpms are installed, in
> the case of rpm-based distributions), and local variable contents.
> 
> This is done by calling an external script /usr/bin/xorg-backtrace,
> which in turn will attach gdb to the server process and parse its
> output. Buffer handling is quite tricky, involving invisible temporary
> files, as the X process is frozen during this time.
> 
> We're using this patch with the also attached xorg-backtrace script
> (which will need a little love to make it more distribution-independent,
> and to improve STDERR handling) and it seems to work reasonably well for
> some time now.
> 
> I think this is something X could benefit from (especially for getting
> better bug reports from users). Would this reasonable to commit?

I'm torn.  On one hand, glibc's backtrace() is a sad joke, and I'd love
to see better debug info.  On the other hand, this seems like exactly
the kind of 'let's work around our deficient OS' crap that we've spent
the last six years deleting.

Perhaps you could write the one coredump handler to rule them all (i.e.
have the kernel invoke the script when a segfault is hit, not out of X's
signal handler), and get that shipped everywhere instead? :)

Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20101020/16fcb3af/attachment.pgp>


More information about the xorg-devel mailing list