Skip to content

[3.14] gh-136870: fix data race in PyThreadState_Clear on sys_tracing_threads (GH-136951) - #136953

Merged
kumaraditya303 merged 1 commit into
python:3.14from
miss-islington:backport-f183996-3.14
Jul 21, 2025
Merged

[3.14] gh-136870: fix data race in PyThreadState_Clear on sys_tracing_threads (GH-136951)#136953
kumaraditya303 merged 1 commit into
python:3.14from
miss-islington:backport-f183996-3.14

Conversation

@miss-islington

@miss-islingtonmiss-islington commented Jul 21, 2025

Copy link
Copy Markdown
Contributor

In free-threading, multiple threads can be cleared concurrently as such the modifications on sys_tracing_threads should be done while holding the profile lock, otherwise it can race with other threads setting up profiling.
(cherry picked from commit f183996)

Co-authored-by: Kumar Aditya kumaraditya@python.org

…ng_threads` (pythonGH-136951)
In free-threading, multiple threads can be cleared concurrently as such the modifications on `sys_tracing_threads` should be done while holding the profile lock, otherwise it can race with other threads setting up profiling.
(cherry picked from commit f183996)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
@kumaraditya303
kumaraditya303 enabled auto-merge (squash) July 21, 2025 20:37
@kumaraditya303
kumaraditya303 merged commit 718fc5b into python:3.14Jul 21, 2025
51 checks passed
kumaraditya303 added a commit to miss-islington/cpython that referenced this pull request Sep 9, 2025
…s_tracing_threads` (pythonGH-136951) (python#136953)
pythongh-136870: fix data race in `PyThreadState_Clear` on `sys_tracing_threads` (pythonGH-136951)
In free-threading, multiple threads can be cleared concurrently as such the modifications on `sys_tracing_threads` should be done while holding the profile lock, otherwise it can race with other threads setting up profiling.
(cherry picked from commit f183996)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
@miss-islington
miss-islington deleted the backport-f183996-3.14 branch January 2, 2026 18:59
Sign up for freeto 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.

2 participants

@miss-islington@kumaraditya303