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

Appearance settings

gh-108976: Make sure instrumentation line returns the correct opcode when instruction instrumentation is stripped#109043

Closed
gaogaotiantian wants to merge 4 commits into
python:mainpython/cpython:mainfrom
gaogaotiantian:fix-instr-instrumentation-crashgaogaotiantian/cpython:fix-instr-instrumentation-crashCopy head branch name to clipboard
Closed

gh-108976: Make sure instrumentation line returns the correct opcode when instruction instrumentation is stripped#109043
gaogaotiantian wants to merge 4 commits into
python:mainpython/cpython:mainfrom
gaogaotiantian:fix-instr-instrumentation-crashgaogaotiantian/cpython:fix-instr-instrumentation-crashCopy head branch name to clipboard

Conversation

@gaogaotiantian

@gaogaotiantian gaogaotiantian commented Sep 7, 2023

Copy link
Copy Markdown
Member

_Py_call_instrumentation_line curently tries to get the original opcode before executing the trace function. The opcode can be INSTRUMENT_INSTRUCTION if instruction event is set. However, the trace function/monitoring callbacks can turn off the instruction event inside the function, which would invalidate the orignal opcode.

line_data->original_opcode won't help in this case as it will still store INSTRUMENT_INSTRUCTION - it won't be refreshed. So, in this case, we use the opcode directly if INSTRUCTION event is turned off on the code object entirely.

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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.