can the kernel show user task stack backtrace ?

Nicholas Mc Guire mcguire at lzu.edu.cn
Fri Jul 31 02:55:55 EST 2009


On Thu, 30 Jul 2009, Alessandro Rubini wrote:

> > We're dealing with some complex (3rd party) applications and I like to see a
> > user task stack backtrace.
> > 
> > (Of course the way to go here is to use a debugger (gdb) and
> >   do a backtrace (with the coredump file).
> 
> Actually, you can intercept SIGSEGV and print your own stack from within
> the signal handler. You can also open /proc/self/maps and print it, to
> ease understanding the various pointers in there, especially if the
> application is using a number of shared libs.
> 
> This is usually easier than getting to a core dump, although there is
> less information than what the core offers.
> 
> I have the code for ARM and I've it on ppc once, but I must dig for the actual
> code.
>
I think libSegFault.so (part of glibc) can do that by simply preloading it 

LD_PRELOAD=/lib/libSegFault.so ./your_segfaulting_app

should do the trick.

hofrat


More information about the Linuxppc-dev mailing list