Visitar URL original
tracing + specialization + EXTENDED_ARG = assertion failure · Issue #91869 · python/cpython · GitHub
Skip to content

tracing + specialization + EXTENDED_ARG = assertion failure #91869

Closed

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

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    3.11only security fixes
    interpreter-core(Objects, Python, Grammar, and Parser dirs)
    on Apr 24, 2022
  2. sweeneyde commented on Apr 24, 2022

    @sweeneyde
    MemberAuthor

    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.

  3. added a commit that references this issue on Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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