Skip to content

Jumping before comprehensions yields SIGSEGV #92311

Closed
@dkrystki

Description

@dkrystki

Full reproducer:

import sys


def fun():
    a = 1  # <---- jump location

    x = [i for i in range(10)]

    c = 3  # current location


def trace(frame, event, arg):
    if event == "line" and frame.f_lineno == 9:
        frame.f_lineno = 4

    return trace


sys.settrace(trace)

if __name__ == "__main__":
    fun()

Jumping from line current location to jump location yields SIGSEGV

Error messages

.venv/bin/python <cwd>/cakeshop.py
Fatal Python error: Segmentation fault

Current thread 0x00007f16eaae5280 (most recent call first):
  File "<cwd>/cakeshop.py", line 14 in trace
  File "<cwd>/cakeshop.py", line 9 in fun
  File "<cwd>/cakeshop.py", line 22 in <module>

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

Your environment

  • CPython versions tested on: 3.9.11, 3.10.1 (3.11.x works as expected same as <3.9)
  • Operating system and architecture: Linux q 5.4.0-42-generic x64

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions