◐ Shell
clean mode source ↗

[3.14] gh-137400: Fix a crash when disabling profiling across all threads (gh-137471) by miss-islington · Pull Request #137648 · python/cpython

…ads (pythongh-137471)

The `PyEval_SetProfileAllThreads` function and other related functions
had a race condition on `tstate->c_profilefunc` that could lead to a
crash when disable profiling or tracing on all threads while another
thread is starting to profile or trace a a call.

There are still potential crashes when threads exit concurrently with
profiling or tracing be enabled/disabled across all threads.
(cherry picked from commit 3626928)

Co-authored-by: Sam Gross <colesbury@gmail.com>

This was referenced

Aug 11, 2025

colesbury

kumaraditya303

kumaraditya303 pushed a commit to miss-islington/cpython that referenced this pull request

Sep 9, 2025