]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-144763: Fix race conditions in tracemalloc (#144779) (#144965)
authorVictor Stinner <vstinner@python.org>
Wed, 18 Feb 2026 19:55:38 +0000 (20:55 +0100)
committerGitHub <noreply@github.com>
Wed, 18 Feb 2026 19:55:38 +0000 (20:55 +0100)
commitf67cf83a4e3c6a28522b53d985928a46aae22b77
treecf41a61473542bbff8e27843437c3a4aca22f8ed
parent2ae7c2fadfe8859e89315ace38f131b9867a1d2c
[3.14] gh-144763: Fix race conditions in tracemalloc (#144779) (#144965)

gh-144763: Fix race conditions in tracemalloc (#144779)

Avoid PyUnstable_InterpreterFrame_GetLine() since it uses a critical
section which can lead to a deadlock.

_PyTraceMalloc_Stop() now also calls PyRefTracer_SetTracer() without
holding TABLES_LOCK() to prevent another deadlock.

(cherry picked from commit 83f4fffe3d78ba368c0d4864c42c7c9c9223f7d1)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Python/tracemalloc.c