◐ Shell
clean mode source ↗

Unrecoverable stack overflow with infinite recursion on macOS

Crash report

What happened?

Hello,

In the CI of cloudpickle, we encountered a crash of the python interpreter due to a stack overflow with python3.14.0a6.
Reverting to python3.14.0a5 fixes the error.

This might be related to GH-130398, with a bad detection of the limit of the stack?
I could not test it locally as I don't own a mac.

class A:
    def __getattribute__(self, name):
        return getattr(self, name)


a = A()
print("Testing Recursion Limit")
try:
    a.test
except RecursionError:
    print("Recursion Limit ok")

Output with python3.14.0a5:

Testing Recursion Limit
Recursion Limit ok

Output with python3.14.0a6:

Fatal Python error: _Py_CheckRecursiveCall: Unrecoverable stack overflow (used 3923 kB)
Python runtime state: initialized

Current thread 0x00000001f839cf80 (most recent call first):
  File "/Users/runner/work/cloudpickle/cloudpickle/test_recursion_error.py", line 3 in __getattribute__
  File "/Users/runner/work/cloudpickle/cloudpickle/test_recursion_error.py", line 3 in __getattribute__
  File "/Users/runner/work/cloudpickle/cloudpickle/test_recursion_error.py", line 3 in __getattribute__
....

CPython versions tested on:

3.14

Operating systems tested on:

macOS

Output from running 'python -VV' on the command line:

No response