Skip to content

Conversation

encukou
Copy link
Member

@encukou encukou commented Sep 30, 2025

This prevents a deadlock when:

  • One thread is in _PyTraceMalloc_Stop, with TABLES_LOCK held, calling PyRefTracer_SetTracer which wants to stop the world
  • Another is thread in PyTraceMalloc_Track, just attached thread state, waiting for TABLES_LOCK

Detaching the thread state while waiting for TABLES_LOCK allows PyRefTracer_SetTracer to stop the world.

…es_lock

This prevents a deadlock when:

- One thread is in `_PyTraceMalloc_Stop`, with `TABLES_LOCK` held, calling
  `PyRefTracer_SetTracer` which wants to stop the world
- Another is thread in `PyTraceMalloc_Track`, just attached thread state, waiting
  for `TABLES_LOCK`

Detaching the thread state while waiting for `TABLES_LOCK` allows
`PyRefTracer_SetTracer` to stop the world.
encukou and others added 2 commits September 30, 2025 15:20
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
@encukou
Copy link
Member Author

encukou commented Sep 30, 2025

!buildbot Intel.ASAN.NoGIL

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @encukou for commit add31a7 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F139449%2Fmerge

The command will test the builders whose names match following regular expression: Intel.ASAN.NoGIL

The builders matched are:

  • x86-64 MacOS Intel ASAN NoGIL PR

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@encukou encukou merged commit 01157e0 into python:main Sep 30, 2025
50 checks passed
@encukou encukou deleted the tables-unlock-detach branch September 30, 2025 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants