-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test_signal: test_interprocess_signal() failed on GHA macOS #110033
Comments
I modified the test locally to reproduce the issue on Linux: def test_interprocess_signal(self):
# Install handlers. This function runs in a sub-process, so we
# don't worry about re-setting the default handlers.
signal.signal(signal.SIGHUP, self.sighup_handler)
signal.signal(signal.SIGUSR1, self.sigusr1_handler)
signal.signal(signal.SIGUSR2, signal.SIG_IGN)
signal.signal(signal.SIGALRM, signal.default_int_handler)
# Let the sub-processes know who to send signals to.
pid = str(os.getpid())
class RefCycle:
pass
print("SIGHUP")
with self.subprocess_send_signal(pid, "SIGHUP") as child:
self.wait_signal(child, 'SIGHUP')
cycle = RefCycle()
cycle.cycle = cycle
cycle.child = child
self.assertEqual(self.got_signals, {'SIGHUP': 1, 'SIGUSR1': 0,
'SIGALRM': 0})
print("SIGHUP--")
print("SIGUSR1")
mask = [signal.SIGUSR1]
with self.assertRaises(SIGUSR1Exception):
print("block")
signal.pthread_sigmask(signal.SIG_BLOCK, mask)
with self.subprocess_send_signal(pid, "SIGUSR1") as child:
print("> unblock")
time.sleep(0.05)
cycle = None
signal.pthread_sigmask(signal.SIG_UNBLOCK, mask)
import gc; gc.collect()
print(">> wait signal")
self.wait_signal(child, 'SIGUSR1')
print(">>> after wait signal?")
self.assertEqual(self.got_signals, {'SIGHUP': 1, 'SIGUSR1': 1,
'SIGALRM': 0})
print("SIGUSR1--") Output:
|
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Sep 28, 2023
Make sure that the subprocess.Popen object is deleted before the test running an exception in a signal handler. Otherwise, Popen.__del__() can get the exception which is logged as "Exception ignored in: ...".
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Sep 28, 2023
Make sure that the subprocess.Popen object is deleted before the test running an exception in a signal handler. Otherwise, Popen.__del__() can get the exception which is logged as "Exception ignored in: ...".
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Sep 28, 2023
Fix test_interprocess_signal() of test_signal. Make sure that the subprocess.Popen object is deleted before the test raising an exception in a signal handler. Otherwise, Popen.__del__() can get the exception which is logged as "Exception ignored in: ...." and the test fails.
vstinner
added a commit
that referenced
this issue
Sep 28, 2023
Fix test_interprocess_signal() of test_signal. Make sure that the subprocess.Popen object is deleted before the test raising an exception in a signal handler. Otherwise, Popen.__del__() can get the exception which is logged as "Exception ignored in: ...." and the test fails.
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Sep 28, 2023
Fix test_interprocess_signal() of test_signal. Make sure that the subprocess.Popen object is deleted before the test raising an exception in a signal handler. Otherwise, Popen.__del__() can get the exception which is logged as "Exception ignored in: ...." and the test fails. (cherry picked from commit 7e0fbf5) Co-authored-by: Victor Stinner <vstinner@python.org>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Sep 28, 2023
Fix test_interprocess_signal() of test_signal. Make sure that the subprocess.Popen object is deleted before the test raising an exception in a signal handler. Otherwise, Popen.__del__() can get the exception which is logged as "Exception ignored in: ...." and the test fails. (cherry picked from commit 7e0fbf5) Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner
added a commit
that referenced
this issue
Sep 28, 2023
…110041) gh-110033: Fix signal test_interprocess_signal() (GH-110035) Fix test_interprocess_signal() of test_signal. Make sure that the subprocess.Popen object is deleted before the test raising an exception in a signal handler. Otherwise, Popen.__del__() can get the exception which is logged as "Exception ignored in: ...." and the test fails. (cherry picked from commit 7e0fbf5) Co-authored-by: Victor Stinner <vstinner@python.org>
csm10495
pushed a commit
to csm10495/cpython
that referenced
this issue
Sep 29, 2023
Fix test_interprocess_signal() of test_signal. Make sure that the subprocess.Popen object is deleted before the test raising an exception in a signal handler. Otherwise, Popen.__del__() can get the exception which is logged as "Exception ignored in: ...." and the test fails.
Yhg1s
pushed a commit
that referenced
this issue
Oct 2, 2023
…110040) gh-110033: Fix signal test_interprocess_signal() (GH-110035) Fix test_interprocess_signal() of test_signal. Make sure that the subprocess.Popen object is deleted before the test raising an exception in a signal handler. Otherwise, Popen.__del__() can get the exception which is logged as "Exception ignored in: ...." and the test fails. (cherry picked from commit 7e0fbf5) Co-authored-by: Victor Stinner <vstinner@python.org>
Glyphack
pushed a commit
to Glyphack/cpython
that referenced
this issue
Sep 2, 2024
Fix test_interprocess_signal() of test_signal. Make sure that the subprocess.Popen object is deleted before the test raising an exception in a signal handler. Otherwise, Popen.__del__() can get the exception which is logged as "Exception ignored in: ...." and the test fails.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The problem is that the first subprocess.Popen may not be removed immediately after
with self.subprocess_send_signal(pid, "SIGHUP") as child:
block, it can survive a little bit. But while it is being deleted automatically, oooops, sigusr1_handler() triggers and raises an SIGUSR1Exception exception which is logged as an "ignored exception", but it is ignored! The test fails.GHA macOS:
build: https://github.com/python/cpython/actions/runs/6340922718/job/17223429951?pr=110026
Linked PRs
The text was updated successfully, but these errors were encountered: