This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients vstinner
Date 2011-05-13.23:01:56
SpamBayes Score 1.20064e-06
Marked as misclassified No
Message-id <1305327717.08.0.00592057633309.issue12073@psf.upfronthosting.co.za>
In-reply-to
Content
When you run the test suite manually and a test hangs, it would be nice to be able to dump immediatly the tracebacks of all threads without having to wait the timeout (which is 1 hour by default...).

Attached patch installs a signal handler for the SIGUSR1 signal. So "kill -USR1 <pid>" dumps immedialty the tracebacks without stopping the tests.

I already used it many times. It's useful and I did not notice any failure introduced by this change. I tested on Linux, FreeBSD and OpenIndiana. faulthandler.register() is not implemented on Windows (which doesn't have SIGUSR1 by the way).

I moved also the call to faulthandler.register() into main() to get the same behaviour using:
./python Lib/test/regrtest.py ...
./python -m test.regrtest ...
./python -m test ...

Actually, the last one doesn't enable faulthandler.
History
Date User Action Args
2011-05-13 23:01:57vstinnersetrecipients: + vstinner
2011-05-13 23:01:57vstinnersetmessageid: <1305327717.08.0.00592057633309.issue12073@psf.upfronthosting.co.za>
2011-05-13 23:01:56vstinnerlinkissue12073 messages
2011-05-13 23:01:56vstinnercreate