Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 35.2k
gh-137400: Fix thread-safety issues when profiling all threads#137518
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
bcb277209b28c8468b8fee79ed43e8ab41da1d876003ec62c1b613bd0f7e62d9225c9aFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Fix a crash in the :term:`free threading` build when disabling profiling or | ||
| tracing across all threads with :c:func:`PyEval_SetProfileAllThreads` or | ||
| :c:func:`PyEval_SetTraceAllThreads` or their Python equivalents | ||
| :func:`threading.settrace_all_threads` and | ||
| :func:`threading.setprofile_all_threads`. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the behavior of this test when this was not fixed? Will it crash because the code object is partially instrumented, or will we miss some trace func calls because the code object is not instrumented at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly it showed up as data races reported by TSan. I don't think I saw any crashes for this one.
The test above (
SetProfileAllThreadsMultiThreaded) would crash before this PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For clarification, this test is related to the change to
_MAYBE_INSTRUMENTwithint check_instrumentation = (tstate->tracing == 0);