Skip to content

gh-155978: Fix leak in update_slot_after_setattr() - #155979

Merged
kumaraditya303 merged 1 commit into
python:mainfrom
nascheme:gh-155978-slot-update-chunk-leak
Aug 18, 2026
Merged

gh-155978: Fix leak in update_slot_after_setattr()#155979
kumaraditya303 merged 1 commit into
python:mainfrom
nascheme:gh-155978-slot-update-chunk-leak

Conversation

@nascheme

@nascheme nascheme commented Aug 17, 2026

Copy link
Copy Markdown
Member

On free-threaded builds, update_slot_after_setattr() stack-allocates a single chunk to queue slot updates, assuming one setattr never needs more. However, update_subclasses() queues one update per affected subclass and so can require heap-allocated chunks. Free those chunks after the slots update.

On free-threaded builds, update_slot_after_setattr() stack-allocates a
single chunk to queue slot updates, assuming one setattr never needs
more.  However, update_subclasses() queues one update per affected
subclass and so can require heap-allocated chunks.  Free those chunks
after the slots update.
@nascheme nascheme added topic-free-threading needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Aug 17, 2026
@nascheme
nascheme marked this pull request as ready for review August 18, 2026 00:52
@nascheme
nascheme requested a review from markshannon as a code owner August 18, 2026 00:52
@kumaraditya303
kumaraditya303 merged commit f381d16 into python:main Aug 18, 2026
64 checks passed
@miss-islington-app

Copy link
Copy Markdown

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

@miss-islington-app

Copy link
Copy Markdown

Sorry, @nascheme and @kumaraditya303, I could not cleanly backport this to 3.15 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker f381d1634c1eddedddcb8ea5d4ae5a4dd7564822 3.15

nascheme added a commit to nascheme/cpython that referenced this pull request Aug 18, 2026
…onGH-155979)

(cherry picked from commit f381d16)

Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
@bedevere-app

bedevere-app Bot commented Aug 18, 2026

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Aug 18, 2026
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.

2 participants