Reproducer
import _testcapi, threading
threading.stack_size(1 << 20) # 1 MiB
def c_recurse(n):
if n:
_testcapi.pyobject_vectorcall(c_recurse, (n - 1,), ())
t = threading.Thread(target=lambda: c_recurse(13))
t.start()
t.join()
Actual result
The process aborts with:
Fatal Python error: _Py_CheckRecursiveCall: Unrecoverable stack overflow (used 1017 kB)
Expected result
RecursionError should be raised instead of aborting the process.
Notes
Lib/test/test_call.py::TestRecursion.test_super_deep expects RecursionError for deep recursion through _testcapi.pyobject_vectorcall().
Environment
- CPython
main
- Linux
x86_64
- glibc
Reproducer
Actual result
The process aborts with:
Expected result
RecursionErrorshould be raised instead of aborting the process.Notes
Lib/test/test_call.py::TestRecursion.test_super_deepexpectsRecursionErrorfor deep recursion through_testcapi.pyobject_vectorcall().Environment
mainx86_64