Skip to content

Reference leak in capi_call_instrumentation() for non-LINE monitoring events #150379

@lpyu001

Description

@lpyu001

Bug report

Bug description:

#instrumentation.c: PyLong leaked per C API monitoring call

capi_call_instrumentation (line 2609) creates offset_obj = PyLong_FromLong(offset) stored in args[2] but never calls Py_DECREF. Affects ~16 _PyMonitoring_Fire*Event C API functions. Unbounded memory growth in long-running apps using C monitoring.

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

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions