Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[3.14] gh-137400: Fix a crash when disabling profiling across all threads (gh-137471)#137648

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

Merged
hugovk merged 1 commit intopython:3.14frommiss-islington:backport-3626928-3.14
Aug 12, 2025

Conversation

@miss-islington
Copy link
Contributor

@miss-islingtonmiss-islington commentedAug 11, 2025
edited by bedevere-appbot
Loading

ThePyEval_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.
(cherry picked from commit3626928)

Co-authored-by: Sam Grosscolesbury@gmail.com

…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>
@colesbury
Copy link
Contributor

@hugovk

From@pablogsal's comment in#137400 (comment):

The worry we have is that this is going to segfault for a bunch of users, and we’ll burn a lot of effort trying to diagnose whether issues are caused by this bug or something else.

So it would be great to get it in 3.14.0 if possible, but we understand if that’s not possible or if you want to wait until the next release.

From our perspective, having users hit segfaults in production when using memray with Python 3.14.0 has the risk to create a significant support burden - we’d have to triage every crash report to determine if it’s this known issue or something new and given the nature of this problem that may be a pain to guide the user or even get a reproducer. Getting the fix into 3.14.0 would save both our users and ourselves from that pain.

That said, we appreciate the trade-offs involved here so if the bigger fix needs more time to bake, the smaller fix in 3.14.0 might be a reasonable compromise to at least prevent the segfaults, even if it doesn’t address all the thread-safety issues.​​​​​​​​​​​​​​​​

@hugovk
Copy link
Member

Let's go with this smaller fix for 3.14.0 RC2. Thanks!

@hugovkhugovk merged commit4ebd928 intopython:3.14Aug 12, 2025
84 of 86 checks passed
kumaraditya303 pushed a commit to miss-islington/cpython that referenced this pull requestSep 9, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@colesburycolesburycolesbury approved these changes

@kumaraditya303kumaraditya303kumaraditya303 approved these changes

Assignees

@hugovkhugovk

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@miss-islington@colesbury@hugovk@kumaraditya303

[8]ページ先頭

©2009-2025 Movatter.jp