8000 gh-130019: Fix data race in _PyType_AllocNoTrack by colesbury · Pull Request #130058 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-130019: Fix data race in _PyType_AllocNoTrack #130058

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 13, 2025

Conversation

colesbury
Copy link
Contributor
@colesbury colesbury commented Feb 12, 2025

The reference count fields, such as ob_tid and ob_ref_shared, may be accessed concurrently in the free threading build by a _Py_TryXGetRef or similar operation. The PyObject header fields will be initialized by _PyObject_Init, so only call memset() to zero-initialize the remainder of the allocation.

The reference count fields, such as `ob_tid` and `ob_ref_shared`, may be
accessed concurrently in the free threading build by a `_Py_TryXGetRef`
or similar operation. The PyObject header fields will be initialized by
`_PyObject_Init`, so only call `memset()` to zero-initialize the remainder
of the allocation.
Copy link
Contributor
@mpage mpage left a comment

Choose a reason for hiding this comment

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

LGTM

Co-authored-by: mpage <mpage@cs.stanford.edu>
@colesbury colesbury added the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Feb 13, 2025
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @colesbury for commit 7131774 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F30617%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-refleak-buildbots Test PR w/ refleak buildbots; report in status section label Feb 13, 2025
@colesbury colesbury merged commit 0559339 into python:main Feb 13, 2025
53 of 54 checks passed
@colesbury colesbury deleted the gh-130019-memset branch February 13, 2025 16:50
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.

3 participants
0