Skip to content
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

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

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
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 16, 2024
…_IsImmortal (pythonGH-121358)

Older stable ABI extensions are allowed to make immortal objects mortal.
Instead, use `_PyUnicode_STATE` (`interned` and `statically_allocated`).
(cherry picked from commit 956270d)

Co-authored-by: Petr Viktorin <[email protected]>
@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
encukou added a commit that referenced this pull request Jul 16, 2024
…y_IsImmortal (GH-121358) (GH-121851)

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

Older stable ABI extensions are allowed to make immortal objects mortal.
Instead, use `_PyUnicode_STATE` (`interned` and `statically_allocated`).
(cherry picked from commit 956270d)

Co-authored-by: Petr Viktorin <[email protected]>
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
…_IsImmortal (pythonGH-121358)

Older stable ABI extensions are allowed to make immortal objects mortal.
Instead, use `_PyUnicode_STATE` (`interned` and `statically_allocated`).
encukou added a commit to encukou/cpython that referenced this pull request Oct 3, 2024
…rt) _Py_IsImmortal (pythonGH-121358) (pythonGH-121851)

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

Older stable ABI extensions are allowed to make immortal objects mortal.
Instead, use `_PyUnicode_STATE` (`interned` and `statically_allocated`).
(cherry picked from commit 956270d)

Co-authored-by: Petr Viktorin <[email protected]>
encukou added a commit that referenced this pull request Oct 4, 2024
…y_IsImmortal (GH-121358) (GH-124938)

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

Older stable ABI extensions are allowed to make immortal objects mortal.
Instead, use `_PyUnicode_STATE` (`interned` and `statically_allocated`).
(cherry picked from commit 956270d)

Co-authored-by: Miss Islington (bot) <[email protected]>
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