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

[3.14] gh-136396: Include instrumentation when creating new copies of the bytecode (GH-136525)#136657

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

Merged
colesbury merged 2 commits intopython:3.14frommiss-islington:backport-d995922-3.14
Jul 15, 2025

Conversation

miss-islington
Copy link
Contributor

@miss-islingtonmiss-islington commentedJul 14, 2025
edited by bedevere-appbot
Loading

Previously, we assumed that instrumentation would happen for all copies of
the bytecode if the instrumentation version on the code object didn't match
the per-interpreter instrumentation version. That assumption was incorrect:
instrumentation will exit early if there are no new "events," even if there
is an instrumentation version mismatch.

To fix this, include the instrumented opcodes when creating new copies of
the bytecode, rather than replacing them with their uninstrumented variants.
I don't think we have to worry about races between instrumentation and creating
new copies of the bytecode: instrumentation and new bytecode creation cannot happen
concurrently. Instrumentation requires that either the world is stopped or the
code object's per-object lock is held and new bytecode creation requires holding
the code object's per-object lock.
(cherry picked from commitd995922)

Co-authored-by: mpagempage@meta.com

…the bytecode (pythonGH-136525)Previously, we assumed that instrumentation would happen for all copies ofthe bytecode if the instrumentation version on the code object didn't matchthe per-interpreter instrumentation version. That assumption was incorrect:instrumentation will exit early if there are no new "events," even if thereis an instrumentation version mismatch.To fix this, include the instrumented opcodes when creating new copies ofthe bytecode, rather than replacing them with their uninstrumented variants.I don't think we have to worry about races between instrumentation and creatingnew copies of the bytecode: instrumentation and new bytecode creation cannot happenconcurrently. Instrumentation requires that either the world is stopped or thecode object's per-object lock is held and new bytecode creation requires holdingthe code object's per-object lock.(cherry picked from commitd995922)Co-authored-by: mpage <mpage@meta.com>
@colesburycolesbury merged commit9ae74e9 intopython:3.14Jul 15, 2025
45 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@colesburycolesburycolesbury approved these changes

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@miss-islington@colesbury@mpage@kumaraditya303

[8]ページ先頭

©2009-2025 Movatter.jp