Forcing a stack trace from the command line?

Willie Walker William.Walker at Sun.COM
Thu Oct 13 13:26:32 EDT 2005


Hi:

I'm working on Orca, a screen reader for the GNOME platform,
and it's being done in Python.  Python is working really for
us right now and I'm quite happy with many aspects of it.

Is there a function like CTRL-Backspace in Python?  There is
a hang in my code somewhere and I'm unable to find it.  When
the hang occurs, all "print" commands seem to stop and I can
only recover by killing the app via Ctrl-Z and kill.  In these
cases, Ctrl-C doesn't work even though I've registered signal
handlers:

   signal.signal(signal.SIGINT, shutdownAndExit)
   signal.signal(signal.SIGQUIT, shutdownAndExit)

What I'd really like to be able to do is to use something like
Java's CTRL-Backspace to dump a stack trace in these instances
just to give me a clue about where my code is during the hang.

I've tried using sys.settrace() to track things, but it seems
to introduce something into the system that prevents me from
being able to reproduce the hang.

Any advice would be greatly appreciated.

Thanks!

Will




More information about the Python-list mailing list