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

gh-117657: Fix data races when writing / reading `ob_gc_bits` by mpage · Pull Request #118292 · python/cpython · GitHub

/ cpython Public

gh-117657: Fix data races when writing / reading ob_gc_bits - #118292

Merged
colesbury merged 4 commits into
python:mainfrom
mpage:gh-117657-tsan-gc-bits
May 8, 2024
Merged

gh-117657: Fix data races when writing / reading ob_gc_bits#118292
colesbury merged 4 commits into
python:mainfrom
mpage:gh-117657-tsan-gc-bits

Conversation

mpage commented Apr 25, 2024
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

Use relaxed atomics when reading / writing to the field. There are still a few places in the GC where we do not use atomics. Those should be safe as the world is stopped.

Sample races reported by TSAN:

mpage added 2 commits April 25, 2024 11:36
Use relaxed atomics when reading / writing to the field. There are still a
few places in the GC where we do not use atomics. Those should be safe as
the world is stopped.

Sample races reported by TSAN:

* [Race between `_PyObject_GC_IS_SHARED()` and `_PyObject_GC_SET_SHARED()`](https://gist.github.com/mpage/ebfd022773f39c33bec68c0993a2249e)
* [Race between `_PyObject_GC_TRACK()` and `_PyObject_GC_IS_SHARED()`](https://gist.github.com/mpage/b53b5c22a2f923bf1571b887bb31ef88)
mpage requested a review from DinoV April 25, 2024 20:42
mpage marked this pull request as ready for review May 7, 2024 17:26
mpage requested a review from colesbury May 7, 2024 17:26
colesbury added the needs backport to 3.13 bugs and security fixes label May 8, 2024
colesbury merged commit cb6f75a into python:main May 8, 2024

Copy link
Copy Markdown

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 8, 2024
…ythonGH-118292)

Use relaxed atomics when reading / writing to the field. There are still a
few places in the GC where we do not use atomics. Those should be safe as
the world is stopped.
(cherry picked from commit cb6f75a)

Co-authored-by: mpage <mpage@meta.com>

bedevere-app Bot commented May 8, 2024

Copy link
Copy Markdown

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

bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label May 8, 2024
colesbury pushed a commit that referenced this pull request May 8, 2024
…H-118292) (#118796)

Use relaxed atomics when reading / writing to the field. There are still a
few places in the GC where we do not use atomics. Those should be safe as
the world is stopped.
(cherry picked from commit cb6f75a)

Co-authored-by: mpage <mpage@meta.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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL