Skip to content

test_call.test_super_deep started segfaulting with 3.14.0a4 freethreading #128954

Open
@mgorny

Description

@mgorny

Crash report

What happened?

test_super_deep (test.test_call.TestRecursion.test_super_deep) ... Fatal Python error: Segmentation fault

The test passes with a3 but segfaults with a4 — so I'm guessing stack frames grew or something. Not sure if this is the kind of regression in code that needs to be fixed, or merely recursion limit needs to be lowered.

This is Gentoo Linux amd64, CPython built with LTO + PGO, CFLAGS are -march=znver2 --param=l1-cache-size=32 --param=l1-cache-line-size=64 -O2 -pipe -frecord-gcc-switches.

Full log: dev-lang:python-3.14.0_alpha4-r100:20250117-163521.txt

CPython versions tested on:

3.14

Operating systems tested on:

Linux

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

Python 3.14.0a4 experimental free-threading build (main, Jan 17 2025, 17:46:22) [GCC 14.2.1 20241221]

Linked PRs

Activity

added
type-crashA hard crash of the interpreter, possibly with a core dump
on Jan 17, 2025
mgorny

mgorny commented on Jan 17, 2025

@mgorny
ContributorAuthor

#127455 seems to indicate that they're hitting a similar problem on Windows.

colesbury

colesbury commented on Jan 17, 2025

@colesbury
Contributor

We can lower the recursion limit, but it seems like it'd be good to reduce the stack usage in the free-threading build:

# define Py_C_RECURSION_LIMIT 10000

added a commit that references this issue on Jan 17, 2025

pythongh-128954: Reorder _PyInterpreterFrame fields for reduced memor…

mgorny

mgorny commented on Jan 18, 2025

@mgorny
ContributorAuthor

I'm going to try if bisect can tell what change caused the issue to appear with a4.

mgorny

mgorny commented on Jan 18, 2025

@mgorny
ContributorAuthor

Bisect points to 128cc47:

commit 128cc47fbd44e3e09c50d9674fe4a4bba3be450c (HEAD)
Author:     Mark Shannon <mark@hotpy.org>
AuthorDate: 2024-12-20 17:52:20 +0100
Commit:     GitHub <noreply@github.com>
CommitDate: 2024-12-20 17:52:20 +0100

    GH-127705: Add debug mode for `_PyStackRef`s inspired by HPy debug mode (GH-128121)

CC @markshannon

added 2 commits that reference this issue on Jan 27, 2025

gh-128954: Reorder _PyInterpreterFrame fields for reduced memory usage (

a6a8c6f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtopic-free-threadingtype-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      `test_call.test_super_deep` started segfaulting with 3.14.0a4 freethreading · Issue #128954 · python/cpython