Skip to content

[3.12] gh-125703: Correctly honour tracemalloc hooks on specialized DECREF paths (GH-125704) #125707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Include/internal/pycore_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@
#ifdef Py_TRACE_REFS
_Py_ForgetReference(op);
#endif
struct _reftracer_runtime_state *tracer = &_PyRuntime.ref_tracer;

Check failure on line 118 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.2.3)

‘_PyRuntimeState’ {aka ‘struct pyruntimestate’} has no member named ‘ref_tracer’

Check failure on line 118 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.2.3)

‘_PyRuntimeState’ {aka ‘struct pyruntimestate’} has no member named ‘ref_tracer’

Check failure on line 118 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.0.15)

‘_PyRuntimeState’ {aka ‘struct pyruntimestate’} has no member named ‘ref_tracer’

Check failure on line 118 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.0.15)

‘_PyRuntimeState’ {aka ‘struct pyruntimestate’} has no member named ‘ref_tracer’

Check failure on line 118 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.1.7)

‘_PyRuntimeState’ {aka ‘struct pyruntimestate’} has no member named ‘ref_tracer’

Check failure on line 118 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.1.7)

‘_PyRuntimeState’ {aka ‘struct pyruntimestate’} has no member named ‘ref_tracer’

Check failure on line 118 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.3.2)

‘_PyRuntimeState’ {aka ‘struct pyruntimestate’} has no member named ‘ref_tracer’

Check failure on line 118 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.3.2)

‘_PyRuntimeState’ {aka ‘struct pyruntimestate’} has no member named ‘ref_tracer’

Check failure on line 118 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-22.04)

‘_PyRuntimeState’ {aka ‘struct pyruntimestate’} has no member named ‘ref_tracer’

Check failure on line 118 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-22.04)

‘_PyRuntimeState’ {aka ‘struct pyruntimestate’} has no member named ‘ref_tracer’

Check failure on line 118 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

‘_PyRuntimeState’ {aka ‘struct pyruntimestate’} has no member named ‘ref_tracer’

Check failure on line 118 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

‘_PyRuntimeState’ {aka ‘struct pyruntimestate’} has no member named ‘ref_tracer’

Check failure on line 118 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Address sanitizer

‘_PyRuntimeState’ {aka ‘struct pyruntimestate’} has no member named ‘ref_tracer’

Check failure on line 118 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Address sanitizer

‘_PyRuntimeState’ {aka ‘struct pyruntimestate’} has no member named ‘ref_tracer’

Check failure on line 118 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'ref_tracer': is not a member of 'pyruntimestate' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 118 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'ref_tracer': is not a member of 'pyruntimestate' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]
if (tracer->tracer_func != NULL) {

Check failure on line 119 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.2.3)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 119 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.2.3)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 119 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.0.15)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 119 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.0.15)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 119 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.1.7)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 119 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.1.7)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 119 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.3.2)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 119 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.3.2)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 119 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-22.04)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 119 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-22.04)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 119 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 119 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 119 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Address sanitizer

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 119 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Address sanitizer

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 119 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

left of 'tracer_func' specifies undefined struct/union '_reftracer_runtime_state' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 119 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

left of 'tracer_func' specifies undefined struct/union '_reftracer_runtime_state' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]
void* data = tracer->tracer_data;

Check failure on line 120 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.2.3)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 120 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.2.3)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 120 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.0.15)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 120 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.0.15)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 120 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.1.7)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 120 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.1.7)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 120 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.3.2)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 120 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.3.2)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 120 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-22.04)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 120 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-22.04)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 120 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 120 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 120 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Address sanitizer

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 120 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Address sanitizer

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 120 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

left of 'tracer_data' specifies undefined struct/union '_reftracer_runtime_state' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 120 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

left of 'tracer_data' specifies undefined struct/union '_reftracer_runtime_state' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]
tracer->tracer_func(op, PyRefTracer_DESTROY, data);

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.2.3)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.2.3)

‘PyRefTracer_DESTROY’ undeclared (first use in this function)

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.2.3)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.2.3)

‘PyRefTracer_DESTROY’ undeclared (first use in this function)

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.0.15)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.0.15)

‘PyRefTracer_DESTROY’ undeclared (first use in this function)

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.0.15)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.0.15)

‘PyRefTracer_DESTROY’ undeclared (first use in this function)

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.1.7)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.1.7)

‘PyRefTracer_DESTROY’ undeclared (first use in this function)

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.1.7)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.1.7)

‘PyRefTracer_DESTROY’ undeclared (first use in this function)

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.3.2)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.3.2)

‘PyRefTracer_DESTROY’ undeclared (first use in this function)

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.3.2)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu SSL tests with OpenSSL (ubuntu-22.04, 3.3.2)

‘PyRefTracer_DESTROY’ undeclared (first use in this function)

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-22.04)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-22.04)

‘PyRefTracer_DESTROY’ undeclared (first use in this function)

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-22.04)

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-22.04)

‘PyRefTracer_DESTROY’ undeclared (first use in this function)

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

‘PyRefTracer_DESTROY’ undeclared (first use in this function)

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

‘PyRefTracer_DESTROY’ undeclared (first use in this function)

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Address sanitizer

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Address sanitizer

‘PyRefTracer_DESTROY’ undeclared (first use in this function)

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Address sanitizer

invalid use of undefined type ‘struct _reftracer_runtime_state’

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Address sanitizer

‘PyRefTracer_DESTROY’ undeclared (first use in this function)

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

left of 'tracer_func' specifies undefined struct/union '_reftracer_runtime_state' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

left of 'tracer_func' specifies undefined struct/union '_reftracer_runtime_state' [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'PyRefTracer_DESTROY': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]

Check failure on line 121 in Include/internal/pycore_object.h

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'PyRefTracer_DESTROY': undeclared identifier [D:\a\cpython\cpython\PCbuild\_freeze_module.vcxproj]
}
destruct(op);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Correctly honour :mod:`tracemalloc` hooks in specialized ``Py_DECREF``
paths. Patch by Pablo Galindo
Loading