Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Debugging forking perl script? GDB?

by martin (Friar)
on Nov 19, 2019 at 09:18 UTC ( [id://11108898]=note: print w/replies, xml ) Need Help??


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:

use Carp (); $SIG{'QUIT'} = \&Carp::confess;
It would be unusual for other code employing signals to use this particular signal for other purposes.

Then, next time you find a looping process, kill it with SIGQUIT. A bash commandline to kill the process with PID 12345 could be:

kill -QUIT 12345
The misbehaving instance of your program will die after dumping the stack trace on STDERR.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11108898]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-20 00:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found