python / cpython

The Python programming language
https://www.python.org
Other
63.39k stars 30.36k forks source link

3.13.0b1 freethreading-debug build: flaky `test_signal.test_stress_modifying_handlers` on s390x (RecursionError) #118989

Open befeleme opened 6 months ago

befeleme commented 6 months ago

Bug report

Bug description:

When building freethreading-debug Python 3.13.0b1 on s390x, test_signal.test_stress_modifying_handlers sometimes fails with RecursionError.

0:24:26 load avg: 1.90 [1/1/1] test_signal failed (1 error)
Re-running test_signal in verbose mode (matching: test_stress_modifying_handlers)
test_stress_modifying_handlers (test.test_signal.StressTest.test_stress_modifying_handlers) ... ERROR
======================================================================
ERROR: test_stress_modifying_handlers (test.test_signal.StressTest.test_stress_modifying_handlers)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/Python-3.13.0b1/Lib/test/test_signal.py", line 1384, in test_stress_modifying_handlers
    cycle_handlers()
    ~~~~~~~~~~~~~~^^
  File "/builddir/build/BUILD/Python-3.13.0b1/Lib/test/test_signal.py", line 1374, in cycle_handlers
    signal.signal(signum, handler)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/Python-3.13.0b1/Lib/signal.py", line 59, in signal
    return _int_to_enum(handler, Handlers)
  File "/builddir/build/BUILD/Python-3.13.0b1/Lib/signal.py", line 31, in _int_to_enum
    return enum_klass(value)
  File "/builddir/build/BUILD/Python-3.13.0b1/Lib/enum.py", line 722, in __call__
    return cls.__new__(cls, value)
           ~~~~~~~~~~~^^^^^^^^^^^^
  File "/builddir/build/BUILD/Python-3.13.0b1/Lib/enum.py", line 1145, in __new__
    def __new__(cls, value):

  File "/builddir/build/BUILD/Python-3.13.0b1/Lib/test/test_signal.py", line 1359, in custom_handler
    def custom_handler(signum, frame):

  File "/builddir/build/BUILD/Python-3.13.0b1/Lib/test/test_signal.py", line 1359, in custom_handler
    def custom_handler(signum, frame):

  File "/builddir/build/BUILD/Python-3.13.0b1/Lib/test/test_signal.py", line 1359, in custom_handler
    def custom_handler(signum, frame):

  [Previous line repeated 236 more times]
RecursionError: maximum recursion depth exceeded
----------------------------------------------------------------------
Ran 1 test in 0.515s
FAILED (errors=1)

CPython versions tested on:

3.13

Operating systems tested on:

Linux

corona10 commented 5 months ago

x86 also happened

0:01:20 load avg: 3.50 [10/22/1] test_signal failed (1 error) (32.6 sec) -- running (2): test_logging (59.6 sec), test_queue (57.4 sec)
test test_signal failed -- Traceback (most recent call last):
  File "/home/dongheena/oss/cpython/Lib/test/test_signal.py", line 1384, in test_stress_modifying_handlers
    cycle_handlers()
    ~~~~~~~~~~~~~~^^
  File "/home/dongheena/oss/cpython/Lib/test/test_signal.py", line 1374, in cycle_handlers
    signal.signal(signum, handler)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/home/dongheena/oss/cpython/Lib/signal.py", line 59, in signal
    return _int_to_enum(handler, Handlers)
  File "/home/dongheena/oss/cpython/Lib/signal.py", line 24, in _int_to_enum
    def _int_to_enum(value, enum_klass):

  File "/home/dongheena/oss/cpython/Lib/test/test_signal.py", line 1359, in custom_handler
    def custom_handler(signum, frame):

  File "/home/dongheena/oss/cpython/Lib/test/test_signal.py", line 1359, in custom_handler
    def custom_handler(signum, frame):

  File "/home/dongheena/oss/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
hroncok commented 1 month ago

Also happens semi-often at ppc64le.