Skip to content

3.12.7: gh-113993 backported without subsequent fixes, causing python3: Objects/unicodeobject.c:15018: intern_common: Assertion _Py_IsImmortal(r)' failed.` #124887

Description

@mgorny

Crash report

What happened?

The 49f6beb ("Make interned strings mortal") backport introduced ABI-breaking assertions into 3.12.7. As a result, Rust stable ABI packages are now crashing on assertions, e.g. from uv's cargo test:

          5 │+python3: Objects/unicodeobject.c:15018: intern_common: Assertion `_Py_IsImmortal(r)' failed.
          6 │+python3: Objects/unicodeobject.c:15018: intern_common: Assertion `_Py_IsImmortal(r)' failed.

Backporting 281ffb6 seems to fix the immediate issue but I haven't checked for more regressions.

CPython versions tested on:

3.12

Operating systems tested on:

Linux

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

Python 3.12.7 (main, Oct 1 2024, 21:49:30) [GCC 14.2.1 20240921]

Activity

  1. added
    type-crashA hard crash of the interpreter, possibly with a core dump
    on Oct 2, 2024
  2. ZeroIntensity commented on Oct 2, 2024

    @ZeroIntensity
    Member

    Ah, this problem again. assert(_Py_IsImmortal(...)) breaks stable ABI extensions -- we're supposed to use assert(_Py_IsImmortalLoose(...)). IIRC, that PR took a while to backport, so there's a chance that it predated _Py_IsImmortalLoose. cc @encukou

  3. self-assigned this
    on Oct 3, 2024
  4. encukou commented on Oct 3, 2024

    @encukou
    Member

    I missed this in the big backport. My apologies :(

  5. encukou commented on Oct 4, 2024

    @encukou
    Member

    I've merged the backport: #124938

  6. mgorny commented on Oct 4, 2024

    @mgorny
    ContributorAuthor

    Thank you!

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

Metadata

Metadata

Assignees

Labels

3.12only security fixestopic-C-APItype-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