Skip to content

Stack overflow error from recursion with 3.14.0rc1 on MacOS#137573

@cdce8p

Description

@cdce8p

Crash report

What happened?

In the pylint / astroid test suite we have a regression test for a common recursion issue on our end. Though the code triggers a deep recursion, so far CPython was still able to resolve it. While getting ready for 3.14, I noticed that a specific test started to crash Python but only on MacOS. Isolated Github action CI runs seem to confirm this, Ubuntu, Windows are completely fine both with 3.13.6 and 3.14.0rc1. However MacOS only passes with 3.13.6 while failing 3.14.0rc1. Noticeable 3.14.0a6 seems to be the last version which reliably still succeeded.

The releases have been downloaded from python.org; used the actions/setup-python action for tests in CI.

To bisect the issue further, I compiled 3.14.0rc1 on my Mac. Strangely though the test now passes, on the same system where the binary from python.org failed previously.

Local tests done with

  • MacOS 14 on M2 Pro
  • Python 3.14.0rc1 (v3.14.0rc1:48f88310044, Jul 22 2025, 13:06:29) [Clang 16.0.0 (clang-1600.0.26.6)] from https://www.python.org/downloads/release/python-3140rc1/ => test fails
  • Python 3.14.0rc1 (tags/v3.14.0rc1:48f88310044, Aug 9 2025, 00:54:21) [Clang 16.0.6 ] compiled manually => test succeeds
CC=/opt/homebrew/opt/llvm@16/bin/clang ./configure --with-openssl=$(brew --prefix openssl@3) --enable-optimizations --with-lto make -j4 -s

Run the test case

git clone --depth 1 --branch v4.0.0b2 https://github.com/pylint-dev/astroid.git cd astroid python -m venv venv source venv/bin/activate pip install pytest==8.4.1 . pytest tests/test_inference.py::test_recursion_on_inference_tip

Output with 3.14.0rc1 from python.org

(venv) MyMacBook-Pro:astroid $ pytest-stests/test_inference.py::test_recursion_on_inference_tip==============================testsessionstarts===================================platformdarwin--Python3.14.0rc1, pytest-8.4.1, pluggy-1.6.0rootdir: /.../astroidconfigfile: pyproject.tomlcollected1itemtests/test_inference.pyFatalPythonerror: _Py_CheckRecursiveCall: Unrecoverablestackoverflow (used3953kB) Pythonruntimestate: initializedCurrentthread0x00000001dc071ec0 (mostrecentcallfirst): File"/.../astroid/astroid/decorators.py", line81ininnerFile"/.../astroid/astroid/nodes/node_classes.py", line451in_infer ... File"/.../astroid/astroid/decorators.py", line44inwrappedFile"/.../astroid/astroid/decorators.py", line81ininnerAborttrap: 6

Output with 3.14.0rc1 compiled locally

tests/test_inference.py::test_recursion_on_inference_tipPASSED

--
I'd be grateful about any pointers to things I'm doing "wrong" in my local build that prevent me from reproducing and bisecting the issue.

CPython versions tested on:

3.14

Operating systems tested on:

macOS

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

Python 3.14.0rc1 (v3.14.0rc1:48f88310044, Jul 22 2025, 13:06:29) [Clang 16.0.0 (clang-1600.0.26.6)]

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.14bugs and security fixesOS-macpendingThe issue will be closed if no feedback is providedtype-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions