Skip to content

tracing + specialization + EXTENDED_ARG = assertion failure #91869

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sweeneyde opened this issue Apr 24, 2022 · 1 comment
Closed

tracing + specialization + EXTENDED_ARG = assertion failure #91869

sweeneyde opened this issue Apr 24, 2022 · 1 comment
Labels
3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@sweeneyde
Copy link
Member

sweeneyde commented Apr 24, 2022

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 failure

This results in Assertion failed: cframe.use_tracing == 0, from here, in the UNPACK_SEQUENCE_ADAPTIVE instruction. Presumably, other specialized opcodes are similar.

@markshannon @brandtbucher

@sweeneyde sweeneyde added type-bug An unexpected behavior, bug, or error 3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Apr 24, 2022
@sweeneyde
Copy link
Member Author

sweeneyde commented 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant