Skip to content
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

Thread sanitizer (free-threading) tests fail: test_signal raises RecursionError #121065

Open
sobolevn opened this issue Jun 26, 2024 · 5 comments
Labels
tests Tests in the Lib/test dir topic-free-threading type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

sobolevn commented Jun 26, 2024

Bug report

 0:02:53 load avg: 5.00 [ 9/22/1] test_signal failed (1 error) (1 min 1 sec) -- running (3): test_logging (2 min 13 sec), test_io (2 min 17 sec), test_queue (1 min 52 sec)
test test_signal failed -- Traceback (most recent call last):
  File "/home/runner/work/cpython/cpython/Lib/test/test_signal.py", line 1384, in test_stress_modifying_handlers
    cycle_handlers()
    ~~~~~~~~~~~~~~^^
  File "/home/runner/work/cpython/cpython/Lib/test/test_signal.py", line 1374, in cycle_handlers
    signal.signal(signum, handler)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/runner/work/cpython/cpython/Lib/signal.py", line 58, in signal
    handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
                             ~~~~~~~~~~~~^^^^^^^^^^^
  File "/home/runner/work/cpython/cpython/Lib/signal.py", line 41, in _enum_to_int
    return int(value)
  File "/home/runner/work/cpython/cpython/Lib/test/test_signal.py", line 1359, in custom_handler
    def custom_handler(signum, frame):
    
  File "/home/runner/work/cpython/cpython/Lib/test/test_signal.py", line 1359, in custom_handler
    def custom_handler(signum, frame):
    
  File "/home/runner/work/cpython/cpython/Lib/test/test_signal.py", line 1359, in custom_handler
    def custom_handler(signum, frame):
    
  [Previous line repeated 237 more times]
RecursionError: maximum recursion depth exceeded

Link: https://github.com/python/cpython/actions/runs/9686054998/job/26727620578

Linked PRs

@skirpichev
Copy link
Contributor

I don't see similar failures before this merge: 22b0de2

@Fidget-Spinner
Copy link
Member

@skirpichev @sobolevn that test is flaky. for example, after 22b0de2, 6f7acaa passed perfectly fine.

@Fidget-Spinner
Copy link
Member

Another example: #121083 came after that commit, and still passes that test.

@vstinner
Copy link
Member

Maybe we can reduce the number of signals sent, or increase the recursion limit.

@colesbury
Copy link
Contributor

Let's disable the test for now and then investigate the root cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir topic-free-threading type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

5 participants