Skip to content

gh-144763: Don't detach the GIL in tracemalloc#144779

Open
vstinner wants to merge 2 commits intopython:mainfrom
vstinner:tracemalloc_dont_detach
Open

gh-144763: Don't detach the GIL in tracemalloc#144779
vstinner wants to merge 2 commits intopython:mainfrom
vstinner:tracemalloc_dont_detach

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Feb 13, 2026

tracemalloc no longer detachs the GIL to acquire its internal lock.

tracemalloc no longer detachs the GIL to acquire its internal lock.
@vstinner
Copy link
Member Author

This change basically reverts commit 01157e0 (PR gh-139449) which fixed another deadlock on tracemalloc.stop() :-) See issue gh-139116.

cc @ZeroIntensity @encukou

Don't call PyRefTracer_SetTracer() while holding TABLES_LOCK().
@vstinner
Copy link
Member Author

This change basically reverts commit 01157e0 (PR #139449) which fixed another deadlock on tracemalloc.stop() :-) See issue #139116.

I pushed a change to avoid the deadlock on tracemalloc.stop(): don't call PyRefTracer_SetTracer() while holding TABLES_LOCK().

@vstinner vstinner marked this pull request as ready for review February 13, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant