GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-113993: For string interning, do not rely on (or assert) _Py_IsImmortal by encukou · Pull Request #121358 · python/cpython

Conversation

@encukou

@encukou encukou commented Jul 4, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

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.

  • Issue: Interned strings are immortal, despite what the documentation says #113993

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
encukou added 2 commits July 4, 2024 13:24
@encukou
Add blurb
70b46c9
@encukou
pythongh-113993: For string interning, do not assert or rely on _Py_I…
4d92f62
…sImmortal

Older stable ABI extensions are allowed to make immortal objects mortal.
Instead, use `_PyUnicode_STATE` (`interned` and `statically_allocated`).
@encukou encukou added the needs backport to 3.13 only security fixes label Jul 4, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Jul 4, 2024
Interned strings are immortal, despite what the documentation says #113993
Closed
@bedevere-app bedevere-app Bot added the awaiting core review label Jul 4, 2024
@encukou encukou mentioned this pull request Jul 4, 2024
python: Objects/unicodeobject.c:15052: intern_static: Assertion '_Py_IsImmortal(s)' failed. in various projects with pyo3-0.21.2 and Python 3.13.0b3 PyO3/pyo3#4309
Closed
@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mgorny mgorny mentioned this pull request Jul 4, 2024
[py3.13] rustworkx: python: ./Include/internal/pycore_object.h:268: _PyObject_Init: Assertion '_PyType_HasFeature(typeobj, Py_TPFLAGS_HEAPTYPE) || _Py_IsImmortal(typeobj)' failed. PyO3/pyo3#4311
Closed
@encukou encukou added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 16, 2024
@bedevere-bot

bedevere-bot commented Jul 16, 2024

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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

miss-islington-app Bot commented Jul 16, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting core review label Jul 16, 2024
@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
@encukou @miss-islington
pythongh-113993: For string interning, do not rely on (or assert) _Py…
ff54019
…_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

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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
@miss-islington @encukou
[3.13] gh-113993: For string interning, do not rely on (or assert) _P…
281ffb6
…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
@encukou @estyxx
pythongh-113993: For string interning, do not rely on (or assert) _Py…
309b6e6
…_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
@miss-islington @encukou
[3.12] pythongh-113993: For string interning, do not rely on (or asse…
3e07c20
…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
@encukou @miss-islington
[3.12] gh-113993: For string interning, do not rely on (or assert) _P…
b3e2c02
…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

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@encukou @mgorny @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.