Skip to content

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

Merged
encukou merged 2 commits into
python:mainfrom
encukou:no-assert-immortal
Jul 16, 2024
Merged

encukou merged 2 commits into
python:mainfrom
encukou:no-assert-immortal

Conversation

@encukou

@encukou encukou commented Jul 4, 2024 •

Copy link
Copy Markdown
Member

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

mgorny commented Jul 4, 2024

Copy link
Copy Markdown
Contributor

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

@bedevere-bot

Copy link
Copy Markdown

🤖 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
@miss-islington-app

Copy link
Copy Markdown

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 <encukou@gmail.com>
@bedevere-app

bedevere-app Bot commented Jul 16, 2024

Copy link
Copy Markdown

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 only 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 <encukou@gmail.com>
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 <encukou@gmail.com>
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) <31488909+miss-islington@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants