-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
gh-137400: Fix a crash when disabling profiling across all threads #137471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
|
🤖 New build scheduled with the buildbot fleet by @colesbury for commit 5e5e4f1 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F137471%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-refleak-buildbots label again. |
Thanks @colesbury for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
…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>
Sorry, @colesbury, I could not cleanly backport this to
|
GH-137648 is a backport of this pull request to the 3.14 branch. |
…ll threads (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>
GH-137649 is a backport of this pull request to the 3.13 branch. |
The
PyEval_SetProfileAllThreads
function and other related functions had a race condition ontstate->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.
sys._setprofileallthreads
race condition #137400