Skip to content

gh-151633: avoid use-after-free in Counter.update - #151634

Merged
kumaraditya303 merged 15 commits into
python:mainfrom
KowalskiThomas:kowalski/fix-avoid-use-after-free-in-counter-update
Nov 9, 2026
Merged

kumaraditya303 merged 15 commits into
python:mainfrom
KowalskiThomas:kowalski/fix-avoid-use-after-free-in-counter-update

Conversation

@KowalskiThomas

@KowalskiThomas KowalskiThomas commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Comment thread Modules/_collectionsmodule.c Resolved
Comment thread Modules/_collectionsmodule.c Resolved
@KowalskiThomas

Copy link
Copy Markdown
Contributor Author

Thanks for the review, I'll take a look ASAP.

Comment thread Modules/_collectionsmodule.c Resolved
@KowalskiThomas
KowalskiThomas force-pushed the kowalski/fix-avoid-use-after-free-in-counter-update branch from 192fc9f to c34c4a2 Compare July 14, 2026 09:16
@KowalskiThomas

Copy link
Copy Markdown
Contributor Author

Sorry in advance, I had to rebase on main (instead of merge) because Git wouldn't let me "merge unrelated histories"... Not sure what happened there...

@KowalskiThomas

Copy link
Copy Markdown
Contributor Author

Just merged main into the branch because there was a conflict!

Comment thread Modules/_collectionsmodule.c Resolved

@eendebakpt eendebakpt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @KowalskiThomas. I added one minor change (also to retrigger the CI), but looks good. Performance for large updates is also improved with these changes, which is a nice side effect.

@KowalskiThomas

Copy link
Copy Markdown
Contributor Author

Thank you @eendebakpt!

@kumaraditya303
kumaraditya303 merged commit 392d6d1 into python:main Nov 9, 2026
56 checks passed
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.

Concurrent calls to Counter.update can cause a use after free

3 participants