Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[3.14] gh-137400: Fix thread-safety issues when profiling all threads (gh-137518)#137730

Merged
colesbury merged 3 commits intopython:3.14python/cpython:3.14from
colesbury:backport-a10152f-3.14colesbury/cpython:backport-a10152f-3.14Copy head branch name to clipboard
Oct 7, 2025
Merged

[3.14] gh-137400: Fix thread-safety issues when profiling all threads (gh-137518)#137730
colesbury merged 3 commits intopython:3.14python/cpython:3.14from
colesbury:backport-a10152f-3.14colesbury/cpython:backport-a10152f-3.14Copy head branch name to clipboard

Conversation

@colesbury
Copy link
Contributor

@colesbury colesbury commented Aug 13, 2025

There were a few thread-safety issues when profiling or tracing all threads via PyEval_SetProfileAllThreads or PyEval_SetTraceAllThreads:

  • The loop over thread states could crash if a thread exits concurrently (in both the free threading and default build)
  • The modification of c_profilefunc and c_tracefunc wasn't thread-safe on the free threading build.

(cherry picked from commit a10152f)

…hreads (pythongh-137518)

There were a few thread-safety issues when profiling or tracing all
threads via PyEval_SetProfileAllThreads or PyEval_SetTraceAllThreads:

* The loop over thread states could crash if a thread exits concurrently
  (in both the free threading and default build)
* The modification of `c_profilefunc` and `c_tracefunc` wasn't
  thread-safe on the free threading build.
(cherry picked from commit a10152f)

Co-authored-by: Sam Gross <colesbury@gmail.com>
@colesbury
Copy link
Contributor Author

This can wait until 3.14.1

@colesbury colesbury merged commit fb699ef into python:3.14 Oct 7, 2025
67 checks passed
@colesbury colesbury deleted the backport-a10152f-3.14 branch October 7, 2025 17:45
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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.