Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.3k
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
The `PyEval_SetProfileAllThreads` function and other related functionshad a race condition on `tstate->c_profilefunc` that could lead to acrash when disable profiling or tracing on all threads while anotherthread is starting to profile or trace a a call.There are still potential crashes when threads exit concurrently withprofiling or tracing be enabled/disabled across all threads.
colesbury commentedAug 7, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
|
bedevere-bot commentedAug 7, 2025
🤖 New build scheduled with the buildbot fleet by@colesbury for commit5e5e4f1 🤖 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. |
3626928 intopython:mainUh oh!
There was an error while loading.Please reload this page.
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 functionshad a race condition on `tstate->c_profilefunc` that could lead to acrash when disable profiling or tracing on all threads while anotherthread is starting to profile or trace a a call.There are still potential crashes when threads exit concurrently withprofiling or tracing be enabled/disabled across all threads.(cherry picked from commit3626928)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 the3.14 branch. |
…ll threads (pythongh-137471)The `PyEval_SetProfileAllThreads` function and other related functionshad a race condition on `tstate->c_profilefunc` that could lead to acrash when disable profiling or tracing on all threads while anotherthread is starting to profile or trace a a call.There are still potential crashes when threads exit concurrently withprofiling or tracing be enabled/disabled across all threads.(cherry picked from commit3626928)Co-authored-by: Sam Gross <colesbury@gmail.com>
GH-137649 is a backport of this pull request to the3.13 branch. |
…eads (gh-137471) (gh-137649)The `PyEval_SetProfileAllThreads` function and other related functionshad a race condition on `tstate->c_profilefunc` that could lead to acrash when disable profiling or tracing on all threads while anotherthread is starting to profile or trace a a call.There are still potential crashes when threads exit concurrently withprofiling or tracing be enabled/disabled across all threads.(cherry picked from commit3626928)
bedevere-bot commentedAug 12, 2025
|
bedevere-bot commentedAug 12, 2025
|
* main:pythongh-137288: Update 3.14 magic numbers (pythonGH-137665)pythongh-135228: When@DataClass(slots=True) replaces a dataclass, make the original class collectible (take 2) (pythonGH-137047)pythongh-126008: Improve docstrings for Tkinter cget and configure methods (pythonGH-133303)pythongh-131885: Use positional-only markers for ``max()`` and ``min()`` (python#131868)pythonGH-137426: Remove code deprecation of `importlib.abc.ResourceLoader` (pythonGH-137567)pythongh-125897: Mark range function parameters as positional only (python#125945)pythongh-137400: Fix a crash when disabling profiling across all threads (pythongh-137471)pythongh-115766: Fix IPv4Interface.is_unspecified (pythonGH-137326)pythongh-128813: cleanup C-API docs for PyComplexObject (pythonGH-137579)pythongh-135953: Profile a module or script with sampling profiler (python#136777) Fix documentation of hash in PyHash_FuncDef (python#137595)
(These were temporary failures, fixed by a buildbot restart:#137186 (comment)) |
…ads (pythongh-137471)The `PyEval_SetProfileAllThreads` function and other related functionshad a race condition on `tstate->c_profilefunc` that could lead to acrash when disable profiling or tracing on all threads while anotherthread is starting to profile or trace a a call.There are still potential crashes when threads exit concurrently withprofiling or tracing be enabled/disabled across all threads.
…ll threads (pythongh-137471) (python#137648)Co-authored-by: Sam Gross <colesbury@gmail.com>
Uh oh!
There was an error while loading.Please reload this page.
The
PyEval_SetProfileAllThreadsfunction and other related functions had a race condition ontstate->c_profilefuncthat 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._setprofileallthreadsrace condition #137400