Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-137562: Fix github-issue number with deallocated objects in cache#137614

Merged
nascheme merged 1 commit into
python:mainpython/cpython:mainfrom
sergey-miryanov:137562-fix-comments-wrong-ref-to-issuesergey-miryanov/cpython:137562-fix-comments-wrong-ref-to-issueCopy head branch name to clipboard
Aug 12, 2025
Merged

gh-137562: Fix github-issue number with deallocated objects in cache#137614
nascheme merged 1 commit into
python:mainpython/cpython:mainfrom
sergey-miryanov:137562-fix-comments-wrong-ref-to-issuesergey-miryanov/cpython:137562-fix-comments-wrong-ref-to-issueCopy head branch name to clipboard

Conversation

@sergey-miryanov

@sergey-miryanov sergey-miryanov commented Aug 10, 2025

Copy link
Copy Markdown
Contributor

@nascheme It seems that #135552 should be referenced in following text:

 * However, since tp_subclasses started being necessary
 * to invalidate caches (e.g. by PyType_Modified), that clearing has created
 * a bug.  If the weakref to the subclass is cleared before a finalizer is
 * called, the cache may not be correctly invalidated.  That can lead to
 * segfaults since the caches can refer to deallocated objects (GH-135552
 * is an example).

Please take a look.

@sergey-miryanov

Copy link
Copy Markdown
Contributor Author

This should skip news I believe.

@nascheme

Copy link
Copy Markdown
Member

Yes, you are correct. GH-91636 is caused by not clearing weakrefs so objects that have tp_clear called on them can later get exposed to Python-level code.

@nascheme nascheme merged commit 654b8d9 into python:main Aug 12, 2025
44 checks passed
Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.