[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] simplify debugging of guestfsd



On Fri, Sep 21, 2012 at 03:51:22PM +0200, Olaf Hering wrote:
> On Fri, Sep 21, Richard W.M. Jones wrote:
> 
> > On Fri, Sep 21, 2012 at 03:40:35PM +0200, Olaf Hering wrote:
> > > gdb is certainly more advanced, something like 'var="gdb --readnow -ex r
> > > -ex bt -ex quit' ; $var guestfsd' would be good enough, or gdb
> > > --command=FILE.
> > > As you say, without adding debuginfo into guest the backtrace would be
> > > not that useful. But its better than nothing.
> > 
> > glibc -- on Fedora -- prints a stack trace on exit, so we've not had a
> > need to get one out using gdb.  A core dump would be the really useful
> > thing for us.
> 
> How does it do that, via a segfault handler? I mean, is that a private
> patch or something in upstream glibc?

What I said there wasn't quite correct.

Every C binary in Fedora is compiled with -D_FORTIFY_SOURCE=2 which
provides a stack trace when string functions fail.  I was probably
confused by seeing those.

But segfaults are not included in this, and they in fact don't
give a stack trace.

Doing
  LD_PRELOAD=/lib64/libSegFault.so
does cause all segfaulting programs to produce a stack trace.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]