Skip to content

instrumentation.c: Use-after-Py_DECREF comparison in call_one_instrument #151524

Closed

Description

@lpyu001

Bug report

Bug description:

Summary

At line 992-993, Py_DECREF(res) then res compared to &_PyInstrumentation_DISABLE. Using a potentially-freed pointer in comparison is UB per C standard.

This is a sub-issue of #146102 with gist details

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Activity

  1. added a commit that references this issue on Jun 16, 2026
  2. added a commit that references this issue on Aug 7, 2026
  3. added 2 commits that reference this issue on Aug 7, 2026
  4. added a commit that references this issue on Aug 8, 2026
  5. added a commit that references this issue on Aug 14, 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

    interpreter-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