Skip to content

gh-117657: Fix TSAN races in setobject.c - #121511

Merged
colesbury merged 1 commit into
python:mainfrom
colesbury:gh-117657-set
Jul 9, 2024
Merged

colesbury merged 1 commit into
python:mainfrom
colesbury:gh-117657-set

Conversation

@colesbury

@colesbury colesbury commented Jul 8, 2024 •

Copy link
Copy Markdown
Contributor

The used field must be written using atomic stores because set_len and iterators may access the field concurrently without holding the per-object lock.

The `used` field must be written using atomic stores because `set_len`
and iterators may access the field concurrently without holding the
per-object lock.

@mpage mpage 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.

LGTM!

@corona10 corona10 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm too

@colesbury
colesbury merged commit 9c08f40 into python:main Jul 9, 2024
@miss-islington-app

Copy link
Copy Markdown

Thanks @colesbury for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

@colesbury
colesbury deleted the gh-117657-set branch July 9, 2024 16:11
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 9, 2024
The `used` field must be written using atomic stores because `set_len`
and iterators may access the field concurrently without holding the
per-object lock.
(cherry picked from commit 9c08f40)

Co-authored-by: Sam Gross <colesbury@gmail.com>
@bedevere-app

bedevere-app Bot commented Jul 9, 2024

Copy link
Copy Markdown

GH-121541 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Jul 9, 2024
colesbury added a commit that referenced this pull request Jul 9, 2024
The `used` field must be written using atomic stores because `set_len`
and iterators may access the field concurrently without holding the
per-object lock.
(cherry picked from commit 9c08f40)

Co-authored-by: Sam Gross <colesbury@gmail.com>
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
The `used` field must be written using atomic stores because `set_len`
and iterators may access the field concurrently without holding the
per-object lock.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants