-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
Keep ob_tid
, ob_ref_local
, and ob_ref_shared
fields valid across allocations in free-threaded build
#115491
Closed
Tracked by
#108219
Labels
Comments
colesbury
added
type-feature
A feature request or enhancement
topic-free-threading
labels
Feb 14, 2024
colesbury
added a commit
to colesbury/cpython
that referenced
this issue
Feb 16, 2024
…ading) This avoids filling the memory occupied by ob_tid, ob_ref_local, and ob_ref_shared with debug bytes (e.g., 0xDD) in mimalloc in the free-threaded build.
colesbury
added a commit
to colesbury/cpython
that referenced
this issue
Feb 16, 2024
…c (free-threading)
colesbury
added a commit
that referenced
this issue
Feb 20, 2024
…#115573) This avoids filling the memory occupied by ob_tid, ob_ref_local, and ob_ref_shared with debug bytes (e.g., 0xDD) in mimalloc in the free-threaded build.
colesbury
added a commit
to colesbury/cpython
that referenced
this issue
Feb 20, 2024
…c (free-threading)
DinoV
pushed a commit
that referenced
this issue
Feb 21, 2024
This still needs the mimalloc support in #115103 to fully preserve the fields, but the changes to filling debug bytes is done now. |
colesbury
added a commit
to colesbury/cpython
that referenced
this issue
Feb 29, 2024
DinoV
pushed a commit
that referenced
this issue
Mar 1, 2024
woodruffw
pushed a commit
to woodruffw-forks/cpython
that referenced
this issue
Mar 4, 2024
…ading) (python#115573) This avoids filling the memory occupied by ob_tid, ob_ref_local, and ob_ref_shared with debug bytes (e.g., 0xDD) in mimalloc in the free-threaded build.
woodruffw
pushed a commit
to woodruffw-forks/cpython
that referenced
this issue
Mar 4, 2024
…c (free-threading) (python#115745)
woodruffw
pushed a commit
to woodruffw-forks/cpython
that referenced
this issue
Mar 4, 2024
pythongh-115491: Fix compiler warning on macOS
adorilson
pushed a commit
to adorilson/cpython
that referenced
this issue
Mar 25, 2024
pythongh-115491: Fix compiler warning on macOS
diegorusso
pushed a commit
to diegorusso/cpython
that referenced
this issue
Apr 17, 2024
…ading) (python#115573) This avoids filling the memory occupied by ob_tid, ob_ref_local, and ob_ref_shared with debug bytes (e.g., 0xDD) in mimalloc in the free-threaded build.
diegorusso
pushed a commit
to diegorusso/cpython
that referenced
this issue
Apr 17, 2024
…c (free-threading) (python#115745)
diegorusso
pushed a commit
to diegorusso/cpython
that referenced
this issue
Apr 17, 2024
pythongh-115491: Fix compiler warning on macOS
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature or enhancement
The free-threaded implementation of dict and list try avoid acquiring locks during read operations. To support this, we need to be able to access the reference count fields of Python objects after they are deallocated (and possibly reallocated). Some of this support is provided by #115103. Additionally, we need to ensure that the debug allocators do not overwrite these fields with "dead" bytes
0xDD
, which might make the object look "alive" by having a non-zero reference count.We still would like to overwrite the rest of the allocation (i.e., from
ob_type
onwards) to detect use-after-frees in debug builds.See also: https://peps.python.org/pep-0703/#optimistically-avoiding-locking
Linked PRs
The text was updated successfully, but these errors were encountered: