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:
|
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
PR #30872 added
_Py_DECREF_SPECIALIZEDwhich callsdestructover the object. WhendestructisPyObject_Freethis skipstracemalloccounting 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
This may also qualify a regression as makes tracemalloc detect incorrect memory usage for these objects
Linked PRs