public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
* FCatch
@ 2006-12-22 16:03 Mike Cvet
  2006-12-22 16:30 ` FCatch Andrew Cagney
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Cvet @ 2006-12-22 16:03 UTC (permalink / raw)
  To: frysk

I just committed a new tool in /bindir called fcatch. Its purpose was to
originally detect an exit (abnormal or otherwise) of a process and
generate a stack trace at that point before the exit.

Due to some current limitations with the TerminatingObserver and
libunwind, fcatch at this point intercepts all signals and prints a
stack trace from the receiving thread. Hopefully multithreaded support
will come soon.

Examples:

Running a process:

[mcvet@towel bindir]$ ./fcatch ~/tester2

([mcvet@towel mcvet]$ kill -3 4391)

SIGQUIT detected: dumping stack trace
#0 0x8048539 in bak () from: /home/mcvet/tester2.c#31
#1 0x80485c6 in baz () from: /home/mcvet/tester2.c#69
#2 0x80485eb in bar () from: /home/mcvet/tester2.c#77
#3 0x80485f8 in foo () from: /home/mcvet/tester2.c#84
#4 0x804863e in main () from: /home/mcvet/tester2.c#96
#5 0x63bf2c in __libc_start_main ()
#6 0x8048451 in _start ()

Attaching to a current process:

[mcvet@towel bindir]$ ./fcatch -p 4400

([mcvet@towel mcvet]$ kill -6 4400)

SIGABRT detected: dumping stack trace
#0 0x804849e in signal_rec ()
from: /home/mcvet/funit-rt-threadstepper.c#77
#1 0x80484ce in signal_parent ()
from: /home/mcvet/funit-rt-threadstepper.c#92
#2 0x8048695 in main () from: /home/mcvet/funit-rt-threadstepper.c#215
#3 0x63bf2c in __libc_start_main ()
#4 0x80483e1 in _start ()


- Mike


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: FCatch
  2006-12-22 16:03 FCatch Mike Cvet
@ 2006-12-22 16:30 ` Andrew Cagney
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cagney @ 2006-12-22 16:30 UTC (permalink / raw)
  To: frysk

Mike Cvet wrote:
> I just committed a new tool in /bindir called fcatch. Its purpose was to
> originally detect an exit (abnormal or otherwise) of a process and
> generate a stack trace at that point before the exit.
>
> Due to some current limitations with the TerminatingObserver and
> libunwind, fcatch at this point intercepts all signals and prints a
> stack trace from the receiving thread. Hopefully multithreaded support
> will come soon.
>   
The limitation is coming from the kernel.

The kernel revokes access to /proc (esp /proc/mem, and /proc/maps) prior 
to notifying frysk of the process terminating event.  This leaves frysk 
with only ptrace access, lame.

Andrew

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-12-22 16:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-22 16:03 FCatch Mike Cvet
2006-12-22 16:30 ` FCatch Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).