Repository navigation
gh-144446: Fix thread-safety of FrameLocalsProxy on executing frames - #156973
Conversation
…rames Synchronize FrameLocalsProxy accesses with the frame's owning thread: accessors run under the frame object's critical section and stop the world when the frame is executing on another thread. Co-authored-by: Sam Gross <colesbury@gmail.com>
mpage
left a comment
There was a problem hiding this comment.
Putting this back on your queue
ambv
left a comment
There was a problem hiding this comment.
I think Matt meant to request changes.
|
When you're done making the requested changes, leave the comment: |
|
🤖 New build scheduled with the buildbot fleet by @kumaraditya303 for commit e94a203 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F156973%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
|
I have made the requested changes; please review again. |
…cleared frames Allow a NULL free variable slot in framelocalsproxy_setfast_lock_held: the frame may have been cleared.
|
I've addressed the review: key lookup ( |
Synchronize FrameLocalsProxy accesses with the frame's owning thread: fast locals are accessed under the frame object's critical section, and with the world stopped when the frame may be executing on another thread.
Changes:
__hash__/__eq__) runs outside it, so no Python code is executed while the world is stopped.keys(),values(),items()andlen()snapshot the fast locals in the region and hold the extra locals dict's critical section while iterating it.PyFrame_GetVaris synchronized the same way.Co-authored-by: Sam Gross colesbury@gmail.com