Traceback of hanged process

Klaas mike.klaas at gmail.com
Mon Jan 8 15:05:16 EST 2007


Hynek Hanke wrote:
> Hello,
>
> please, how do I create a pythonic traceback from a python process that
> hangs and is not running in an interpreter that I executed manually
> or it is but doesn't react on CTRL-C etc? I'm trying to debug a server
> implemented in Python, so I need some analog of 'gdb attach' for C.
>
> Unfortunatelly, googling and reading documentation revealed nothing, so
> please excuse if this question is dumb.

In python2.5, you can run a background thread that listens on a port or
unix socket, and prints a formatted version of sys._current_frames() to
stderr.  

-Mike




More information about the Python-list mailing list