Skip to content

gh-113993: For string interning, do not rely on (or assert) _Py_IsImmortal #121358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 16, 2024

Conversation

encukou
Copy link
Member

@encukou encukou commented Jul 4, 2024

Older stable ABI extensions are allowed to make immortal objects mortal.
Instead of _Py_IsImmortal, use _PyUnicode_STATE (interned and
statically_allocated), or skip asserts altogether.

encukou added 2 commits July 4, 2024 13:24
…sImmortal

Older stable ABI extensions are allowed to make immortal objects mortal.
Instead, use `_PyUnicode_STATE` (`interned` and `statically_allocated`).
@mgorny
Copy link
Contributor

mgorny commented Jul 4, 2024

Thanks. I can confirm that it fixes the problem that I've hit with rustworkx and pyproject-fmt-rust.

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @encukou for commit 4d92f62 🤖

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 16, 2024
@encukou encukou merged commit 956270d into python:main Jul 16, 2024
55 of 58 checks passed
@miss-islington-app
Copy link

Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@encukou encukou deleted the no-assert-immortal branch July 16, 2024 13:17
@bedevere-app
Copy link

bedevere-app bot commented Jul 16, 2024

GH-121851 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants