[New-bugs-announce] [issue12073] regrtest: use faulthandler to dump the tracebacks on SIGUSR1

STINNER Victor report at bugs.python.org
Sat May 14 01:01:57 CEST 2011

New submission from STINNER Victor <victor.stinner at haypocalc.com>:

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.

components: Tests
files: regrtest_sigusr1.patch
keywords: patch
messages: 135947
nosy: haypo
priority: normal
severity: normal
status: open
title: regrtest: use faulthandler to dump the tracebacks on SIGUSR1
versions: Python 3.3
Added file: http://bugs.python.org/file21995/regrtest_sigusr1.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list