One way would be to see which test in the test suite hangs. But it sounds like that hasn't been implemented. ;)
Another way would be to pepper the code with print statements to figure out at what stage in the program's execution you most recently got a heartbeat before things fell silent. Or put a print inside of each while loop.
Another way would be to run the Perl debugger and watch closely. Eventually you'll find the loop.
And yet another way would be to implement a %SIG handler to catch INT, which you will trigger by hitting control-C when you sense the program has hung. Set a sig handler that provides some useful information:
use Carp;
$SIG{INT} = sub { croak shift };
while(1) {
sleep 1;
}
When I run this, and then hit control-C, I am told the line number within the sig handler's subroutine where termination occurred, but I'm also told the line number where the SIG was intercepted. If you hit control-C when you're stuck in the loop, that second line number reported will be a line inside the loop.
Be sure to remove the sig handler once you get it figured out.
|