in reply to Debugging forking perl script? GDB?
You stated you don't want to introduce signal handling code but a signal handler could actually be the least intrusive approach. Once per process, like in the code that runs in each freshly forked child, run something like:
It would be unusual for other code employing signals to use this particular signal for other purposes.use Carp (); $SIG{'QUIT'} = \&Carp::confess;
Then, next time you find a looping process, kill it with SIGQUIT. A bash commandline to kill the process with PID 12345 could be:
The misbehaving instance of your program will die after dumping the stack trace on STDERR.kill -QUIT 12345
|
|---|