Skip to content

tracing + specialization + EXTENDED_ARG = assertion failure #91869

Closed
@sweeneyde

Description

@sweeneyde

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions