]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-128679: Fix tracemalloc.stop() race conditions (#128893)
authorVictor Stinner <vstinner@python.org>
Thu, 16 Jan 2025 12:53:18 +0000 (13:53 +0100)
committerGitHub <noreply@github.com>
Thu, 16 Jan 2025 12:53:18 +0000 (13:53 +0100)
commit3193cb5ef87b77158d5c9bef99ae445cb82727de
tree5306830904e63c48027167378240538f8dafdc18
parent313b96eb8b8d0ad3bac58d633822a0a3705ce60b
gh-128679: Fix tracemalloc.stop() race conditions (#128893)

tracemalloc_alloc(), tracemalloc_realloc(), tracemalloc_free(),
_PyTraceMalloc_TraceRef() and _PyTraceMalloc_GetMemory() now check
'tracemalloc_config.tracing' after calling TABLES_LOCK().

_PyTraceMalloc_TraceRef() now always returns 0.
Lib/test/test_tracemalloc.py
Misc/NEWS.d/next/Library/2025-01-15-21-41-51.gh-issue-128679.tq10F2.rst [new file with mode: 0644]
Modules/_testcapimodule.c
Python/tracemalloc.c