tracing + specialization + EXTENDED_ARG = assertion failure #91869
Copy link
Copy link
Closed
Labels
3.11only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
I found this while working on #91713
def f(x):
( # EXTENDED_ARG + UNPACK_SEQUENCE
y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y, y,y,y,y,y,
) = x
for _ in range(20):
f(range(300)) # warmup
import sys
sys.settrace(print)
f(range(300)) # assertion failureThis results in Assertion failed: cframe.use_tracing == 0, from here, in the UNPACK_SEQUENCE_ADAPTIVE instruction. Presumably, other specialized opcodes are similar.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
3.11only security fixesonly security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Activity
sweeneyde commentedon Apr 24, 2022
I won't have time to work on it this week, but(looks like I found time)One potential solution could be to make EXTENDED_ARG always check for tracing and add an EXTEDED_ARG_QUICK that doesn't check for tracing.
gh-91869: Fix tracing of specialized instructions with extended args (G…