Skip to content

gh-137400: Stop the world when swapping profile functions #137472

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

Closed

Conversation

godlygeek
Copy link
Contributor

@godlygeek godlygeek commented Aug 6, 2025

One thread's profile function or profile object can be changed from another thread, for instance by sys._setprofileallthreads. This can lead to crashes unless the two threads are synchronized. We need a stop-the-world to ensure that the thread whose profile function or profile object is being changed is in a state where it's not in the middle of using either of those pointers.

One thread's profile function or profile object can be changed from
another thread, for instance by `sys._setprofileallthreads`. This can
lead to crashes unless the two threads are synchronized. We need
a stop-the-world to ensure that the thread whose profile function or
profile object is being changed is in a state where it's not in the
middle of using either of those pointers.

Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
@godlygeek
Copy link
Contributor Author

CC: @colesbury @pablogsal

@godlygeek
Copy link
Contributor Author

Ah, nevermind, I see @colesbury beat me to it with #137471 and added a test to boot.

@godlygeek godlygeek closed this Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant