Skip to content

gh-159739: Keep descriptor metadata dictionaries alive during insertion - #160193

Merged
JelleZijlstra merged 1 commit into
python:mainfrom
jelle-openai:jelle/codex/gh-159739-descriptor-metadata-dict
Oct 22, 2026
Merged

JelleZijlstra merged 1 commit into
python:mainfrom
jelle-openai:jelle/codex/gh-159739-descriptor-metadata-dict

Conversation

@jelle-openai

@jelle-openai jelle-openai commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

The classmethod and staticmethod metadata setters dropped their reference to the descriptor dictionary before inserting the new value. A key comparison or value finalizer can replace the dictionary during insertion, leaving the operation using released memory. Keep the dictionary alive until insertion finishes. Backport to 3.15 and 3.14.

…nsertion

The classmethod and staticmethod metadata setters dropped their reference to the descriptor dictionary before inserting the new value. A key comparison or value finalizer can replace the dictionary during insertion, leaving the operation using released memory. Keep the dictionary alive until insertion finishes. Backport to 3.15 and 3.14.
@JelleZijlstra
JelleZijlstra merged commit a076a55 into python:main Oct 22, 2026
58 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @jelle-openai for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

@JelleZijlstra JelleZijlstra added needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Oct 22, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @jelle-openai for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @jelle-openai for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Oct 22, 2026

Copy link
Copy Markdown

GH-160382 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Oct 22, 2026
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 22, 2026
…nsertion (pythonGH-160193)

The classmethod and staticmethod metadata setters dropped their reference to the descriptor dictionary before inserting the new value. A key comparison or value finalizer can replace the dictionary during insertion, leaving the operation using released memory. Keep the dictionary alive until insertion finishes. Backport to 3.15 and 3.14.
(cherry picked from commit a076a55ad2a318cd8b7010d85ccf21ccd0a98555)

Co-authored-by: Jelle Zijlstra <[email protected]>
@bedevere-app

bedevere-app Bot commented Oct 22, 2026

Copy link
Copy Markdown

GH-160383 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Oct 22, 2026
@miss-islington-app

Copy link
Copy Markdown

Sorry @jelle-openai and @JelleZijlstra, I had trouble completing the backport.

Please retry by removing and re-adding the "needs backport to 3.14" label.
If that does not work, please backport manually with cherry_picker, see the devguide for more information.

cherry_picker a076a55ad2a318cd8b7010d85ccf21ccd0a98555 3.14

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 22, 2026
…nsertion (pythonGH-160193)

The classmethod and staticmethod metadata setters dropped their reference to the descriptor dictionary before inserting the new value. A key comparison or value finalizer can replace the dictionary during insertion, leaving the operation using released memory. Keep the dictionary alive until insertion finishes. Backport to 3.15 and 3.14.
(cherry picked from commit a076a55ad2a318cd8b7010d85ccf21ccd0a98555)

Co-authored-by: Jelle Zijlstra <[email protected]>
@miss-islington-app

Copy link
Copy Markdown

Sorry @jelle-openai and @JelleZijlstra, I had trouble completing the backport.

Please retry by removing and re-adding the "needs backport to 3.15" label.
If that does not work, please backport manually with cherry_picker, see the devguide for more information.

cherry_picker a076a55ad2a318cd8b7010d85ccf21ccd0a98555 3.15

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.

2 participants