Skip to content

Crash when deleting frame.f_trace_opcodes in 3.13 #156189

Description

@serhiy-storchaka

Crash report

del frame.f_trace_opcodes crashes in 3.13.

>>> import sys
>>> frame = sys._getframe()
>>> del frame.f_trace_opcodes
Segmentation fault

frame_settrace_opcodes() passes the value to PyBool_Check() without checking it for NULL, and the setter is called with NULL when the attribute is deleted. del frame.f_trace_lines is safe, because it is a PyMemberDef entry.

In 3.14 and newer the accessor is generated by Argument Clinic, whose @setter rejects the deletion with AttributeError, so only 3.13 is affected.

Linked PRs

Activity

  1. added
    3.13only security fixes
    interpreter-core(Objects, Python, Grammar, and Parser dirs)
    type-crashA hard crash of the interpreter, possibly with a core dump
    on Aug 21, 2026
  2. added a commit that references this issue on Aug 21, 2026
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.13only security fixesinterpreter-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