Skip to content
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

gh-115491: Keep some fields valid across allocations in obmalloc (free-threading) #115745

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

colesbury
Copy link
Contributor

@colesbury colesbury commented Feb 20, 2024

This avoids overwriting the first few fields in the PyObject header with debug bytes (like 0xDD for dead bytes) in the free-threaded build. These fields may be accessed for a period after an object is deallocated.

For simplicity, this skips some of the filling of debug bytes for the "realloc" calls in the free-threaded build, because that case is more complex. The calls that delegate to mimalloc will be filled by mimalloc with debug bytes anyways.

Copy link
Contributor

@DinoV DinoV left a comment

Choose a reason for hiding this comment

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

LGTM!

@DinoV DinoV merged commit 347acde into python:main Feb 21, 2024
38 checks passed
@colesbury colesbury deleted the gh-115491-debug-fill-obmalloc branch February 21, 2024 18:00
woodruffw pushed a commit to woodruffw-forks/cpython that referenced this pull request Mar 4, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
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