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-118561: Fix crash involving list.extend in free-threaded build #118723

Merged
merged 2 commits into from
May 9, 2024

Conversation

colesbury
Copy link
Contributor

@colesbury colesbury commented May 7, 2024

The list_preallocate_exact function did not zero initialize array contents. In the free-threaded build, this could expose uninitialized memory to concurrent readers between the call to list_preallocate_exact and the filling of the array contents with items.

The `list_preallocate_exact` function did not zero initialize array
contents. In the free-threaded build, this could expose uninitialized
memory to concurrent readers between the call to
`list_preallocate_exact` and the filling of the array contents with
items.
Copy link
Member

@corona10 corona10 left a comment

Choose a reason for hiding this comment

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

lgtm

…e-118561.wNMKVd.rst

Co-authored-by: Donghee Na <donghee.na92@gmail.com>
@colesbury colesbury added the needs backport to 3.13 bugs and security fixes label May 9, 2024
@colesbury colesbury enabled auto-merge (squash) May 9, 2024 18:31
@colesbury colesbury merged commit 2402715 into python:main May 9, 2024
37 checks passed
@miss-islington-app
Copy link

Thanks @colesbury for the PR 🌮🎉.. 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 9, 2024
…ld (pythonGH-118723)

The `list_preallocate_exact` function did not zero initialize array
contents. In the free-threaded build, this could expose uninitialized
memory to concurrent readers between the call to
`list_preallocate_exact` and the filling of the array contents with
items.
(cherry picked from commit 2402715)

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

bedevere-app bot commented May 9, 2024

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

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label May 9, 2024
colesbury added a commit that referenced this pull request May 9, 2024
…ild (GH-118723) (#118863)

The `list_preallocate_exact` function did not zero initialize array
contents. In the free-threaded build, this could expose uninitialized
memory to concurrent readers between the call to
`list_preallocate_exact` and the filling of the array contents with
items.
(cherry picked from commit 2402715)

Co-authored-by: Sam Gross <colesbury@gmail.com>
SonicField pushed a commit to SonicField/cpython that referenced this pull request May 10, 2024
…ld (python#118723)

The `list_preallocate_exact` function did not zero initialize array
contents. In the free-threaded build, this could expose uninitialized
memory to concurrent readers between the call to
`list_preallocate_exact` and the filling of the array contents with
items.
@colesbury colesbury deleted the gh-118561-list-extend branch May 20, 2024 15:49
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