Skip to content

Build fails with Py_STACKREF_DEBUG set. #135125

Closed

Description

@markshannon

Bug report

Bug description:

I think this is a relatively recent regression, probably in the last month or so.

Can be reproduced by uncommenting the line:

// #define Py_STACKREF_DEBUG 1

in pycore_structs.h

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Activity

  1. markshannon commented on Jun 6, 2025

    @markshannon
    MemberAuthor

    Bisected to 6dcb0fd

  2. added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)
    buildThe build process and cross-build
    on Jun 7, 2025
  3. efimov-mikhail commented on Oct 1, 2025

    @efimov-mikhail
    Member

    Bisected to 6dcb0fd

    Yes, problem was introduced here, _PyStackRef_FromPyObjectBorrow is incorrect on mortal objects in PyStackRef debug mode.

  4. added a commit that references this issue on Oct 23, 2025
  5. added a commit that references this issue on Dec 6, 2025
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

    buildThe build process and cross-buildinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions