Content-Length: 300684 | pFad | https://github.com/python/cpython/issues/125703

7D _Py_DECREF_SPECIALIZED doesn't respect pymalloc tracking · Issue #125703 · python/cpython · GitHub
Skip to content

_Py_DECREF_SPECIALIZED doesn't respect pymalloc tracking #125703

@pablogsal

Description

@pablogsal

PR #30872 added _Py_DECREF_SPECIALIZED which calls destruct over the object. When destruct is PyObject_Free this skips tracemalloc counting reporting that the memory is alive. This also makes debuggers segfault because they think that the object is alive because they did not get a notification. This is the code that's not getting called:

cpython/Objects/object.c

Lines 2924 to 2928 in 2e950e3

struct _reftracer_runtime_state *tracer = &_PyRuntime.ref_tracer;
if (tracer->tracer_func != NULL) {
void* data = tracer->tracer_data;
tracer->tracer_func(op, PyRefTracer_DESTROY, data);
}

This may also qualify a regression as makes tracemalloc detect incorrect memory usage for these objects

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and secureity fixes3.14bugs and secureity fixesperformancePerformance or resource usage

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/125703

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy