diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-03 15:20:31 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-03 15:20:31 (GMT) |
commit | f44ce8748d4dcae7a359b147e5944acb4ed94638 (patch) | |
tree | a41d80ec1f3e914650540f617a12f6b18ef2f945 /Lib/test | |
parent | 441f935228e1c2f15d3694221cdb0524de2abe0f (diff) | |
download | cpython-f44ce8748d4dcae7a359b147e5944acb4ed94638.zip cpython-f44ce8748d4dcae7a359b147e5944acb4ed94638.tar.gz cpython-f44ce8748d4dcae7a359b147e5944acb4ed94638.tar.bz2 |
Issue #8407: disable faulthandler timeout thread on all platforms
The problem is not specific to Mac OS X.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_signal.py | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py index 1a28ced..0a43fa7 100644 --- a/Lib/test/test_signal.py +++ b/Lib/test/test_signal.py @@ -494,6 +494,7 @@ class PthreadSigmaskTests(unittest.TestCase): self.assertRaises(RuntimeError, signal.pthread_sigmask, 1700, []) def test_block_unlock(self): + import faulthandler pid = os.getpid() signum = signal.SIGUSR1 @@ -503,20 +504,18 @@ class PthreadSigmaskTests(unittest.TestCase): def read_sigmask(): return signal.pthread_sigmask(signal.SIG_BLOCK, []) - if sys.platform == "darwin": - import faulthandler - # The fault handler timeout thread masks all signals. If the main - # thread masks also SIGUSR1, all threads mask this signal. In this - # case, on Mac OS X, if we send SIGUSR1 to the process, the signal - # is pending in the main or the faulthandler timeout thread. - # Unblock SIGUSR1 in the main thread calls the signal handler only - # if the signal is pending for the main thread. - # - # Stop the faulthandler timeout thread to workaround this problem. - # Another solution would be to send the signal directly to the main - # thread using pthread_kill(), but Python doesn't expose this - # function. - faulthandler.cancel_dump_tracebacks_later() + # The fault handler timeout thread masks all signals. If the main + # thread masks also SIGUSR1, all threads mask this signal. In this + # case, if we send SIGUSR1 to the process, the signal is pending in the + # main or the faulthandler timeout thread. Unblock SIGUSR1 in the main + # thread calls the signal handler only if the signal is pending for the + # main thread. + # + # Stop the faulthandler timeout thread to workaround this problem. + # Another solution would be to send the signal directly to the main + # thread using pthread_kill(), but Python doesn't expose this + # function. + faulthandler.cancel_dump_tracebacks_later() # Install our signal handler old_handler = signal.signal(signum, handler) |