FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-106581: Fix instrumentation in tier 2 by brandtbucher · Pull Request #108493 · python/cpython · GitHub

/ cpython Public

GH-106581: Fix instrumentation in tier 2 - #108493

Merged
brandtbucher merged 3 commits into
python:mainfrom
brandtbucher:uresume
Aug 25, 2023
Merged

GH-106581: Fix instrumentation in tier 2#108493
brandtbucher merged 3 commits into
python:mainfrom
brandtbucher:uresume

Conversation

brandtbucher commented Aug 25, 2023
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

RESUME is currently written in a way that ignores changes in tracing events when running in our tier two executor. This can manifest itself as assertion errors on debug builds and missing/extra events on release builds when changing events just before an inlined call:

python: Python/instrumentation.c:1117: _Py_call_instrumentation_line: Assertion `is_version_up_to_date(code, tstate->interp)' failed.

This PR modifies RESUME to detect this condition and deoptimize back to tier one in these cases.

brandtbucher added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump labels Aug 25, 2023
brandtbucher self-assigned this Aug 25, 2023
Comment thread Python/bytecodes.c Outdated
if (_PyFrame_GetCode(frame)->_co_instrumentation_version != tstate->interp->monitoring_version) {
int err = _Py_Instrument(_PyFrame_GetCode(frame), tstate->interp);
ERROR_IF(err, error);
#if TIER_ONE

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I'd indent the #if etc. to align with the code it guards (we're using a different style here than elsewhere).

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL