gh-150206: Fix gdb test failure with tail-call interpreter#153801
Open
weixlu wants to merge 1 commit into
Open
gh-150206: Fix gdb test failure with tail-call interpreter#153801weixlu wants to merge 1 commit into
weixlu wants to merge 1 commit into
Conversation
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As reported in #150206 , test_gdb fails with tail-call interpreter. It turns out that
_gdbframe.read_var('frame')isn't reliable on tail-call interpreter, so we have to walk through the interpreter frames. There is a complex case intest_miscwhere _PyEval_EvalFrameDefault C frame is nested, which is handled with extra care. Please refer to the code change for details, and I leave some annotation to explain the flow.This PR should only affect tail-call build. Test pass with the following configs:
--with-tail-call-interp&CFLAGS="-O0"CFLAGS="-O0"CFLAGS="-O0"Why read_var('frame') isn't reliable on tail-call build?
Typically currently-executing frame is stored in the
framefield. But for tail-call build, it passes this as an argument through_TAIL_CALL_*handlers, So frame won't be updated, but stays pinned to the frame that started the eval loop