Dumping the state of a deadlocked process

andre.naess at gmail.com andre.naess at gmail.com
Fri Oct 6 15:59:31 EDT 2006


Hi all

I'm currently having some issues with a process getting deadlocked. The
problem is that the only way I can seem to find information about where
it deadlocks is by making a wild guess, insert a pdb.set_trace() before
this point, and then step until it locks up, hoping that I've guessed
right.

The frustrating part is that most of the time my guesses are wrong.

It would be really nice if I could send the python process some signal
which would cause it to print the current stacktrace and exit
immediately. That way I would quickly be able to pinpoint where in the
code the deadlock happens. Java has a somewhat similar feature where
you can send a running VM process a SIGQUIT, to which it will respond
by dumping all current threads and lots of other information on stdout.

Is this possible somehow?




More information about the Python-list mailing list