Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-144446: Fix some frame object thread-safety issues#144479

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
colesbury wants to merge2 commits intopython:main
base:main
Choose a base branch
Loading
fromcolesbury:gh-144446-frame-free-threading

Conversation

@colesbury
Copy link
Contributor

@colesburycolesbury commentedFeb 4, 2026
edited by bedevere-appbot
Loading

Fix thread-safety issues when accessing frame attributes while another thread is executing the frame:

  • Add critical section to frame_repr() to prevent races when accessing the frame's code object and line number

  • Add _Py_NO_SANITIZE_THREAD to PyUnstable_InterpreterFrame_GetLasti() to allow intentional racy reads of instr_ptr.

  • Fix take_ownership() to not write to the original frame's f_executable

Fix thread-safety issues when accessing frame attributes while anotherthread is executing the frame:- Add critical section to frame_repr() to prevent races when accessing  the frame's code object and line number- Add _Py_NO_SANITIZE_THREAD to PyUnstable_InterpreterFrame_GetLasti()  to allow intentional racy reads of instr_ptr.- Fix take_ownership() to not write to the original frame's f_executable
@colesbury
Copy link
ContributorAuthor

There are still some races when accessing variables through frame.f_locals, which will be address separately.

@colesburycolesbury marked this pull request as ready for reviewFebruary 4, 2026 18:08
@colesburycolesbury requested a review frommpageFebruary 4, 2026 18:37
@colesburycolesbury added the needs backport to 3.14bugs and security fixes labelFeb 4, 2026
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

@mpagempageAwaiting requested review from mpage

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@colesbury

[8]ページ先頭

©2009-2026 Movatter.jp