FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-159739: Break reference cycles involving property objects by jelle-openai · Pull Request #159978 · python/cpython · GitHub

Repository navigation

gh-159739: Break reference cycles involving property objects - #159978

Merged
JelleZijlstra merged 1 commit into
python:mainfrom
jelle-openai:jelle/codex/gh-159739-property-cycles
Oct 21, 2026
Merged

JelleZijlstra merged 1 commit into
python:mainfrom
jelle-openai:jelle/codex/gh-159739-property-cycles

Conversation

jelle-openai commented Oct 20, 2026 •
edited
Loading

Copy link
Copy Markdown
Contributor

Break reference cycles involving property objects. The garbage collector can see the property's references to its accessors and name, but its tp_clear only clears the docstring. If an unreachable cycle must be broken through one of the other fields, gc.collect() leaves the cycle alive and leaks the objects. You can only exploit this to get a memory leak by setting .__name__ or re-calling __init__.

Backport to 3.15 and 3.14.

JelleZijlstra added needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Oct 20, 2026
JelleZijlstra merged commit 4101d59 into python:main Oct 21, 2026
62 checks passed

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.
🐍🍒⛏🤖

bedevere-app Bot commented Oct 21, 2026

Copy link
Copy Markdown

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

bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Oct 21, 2026

bedevere-app Bot commented Oct 21, 2026

Copy link
Copy Markdown

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

bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Oct 21, 2026
JelleZijlstra pushed a commit that referenced this pull request Oct 21, 2026
…H-159978) (#160014)

(cherry picked from commit 4101d59)

Co-authored-by: Jelle Zijlstra <jelle@openai.com>
JelleZijlstra pushed a commit that referenced this pull request Oct 21, 2026
…H-159978) (#160015)

(cherry picked from commit 4101d59)

Co-authored-by: Jelle Zijlstra <jelle@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL