Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f44ce874
Commit
f44ce874
authored
May 03, 2011
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #8407: disable faulthandler timeout thread on all platforms
The problem is not specific to Mac OS X.
parent
441f9352
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
Lib/test/test_signal.py
Lib/test/test_signal.py
+13
-14
No files found.
Lib/test/test_signal.py
View file @
f44ce874
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment