Skip to content

Conversation

@vstinner
Copy link
Member

@vstinner vstinner commented Oct 27, 2025

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍

@vstinner
Copy link
Member Author

Calling OpenThread(), GetThreadDescription() and _Py_EncodeLocaleRaw() is not async signal-safe. For example, _Py_EncodeLocaleRaw() allocates memory on the heap memory. But on Windows, signal handlers are called in a temporary thread. So it should be ok to call these functions in faulthandler signal handlers.

Copy link
Contributor

@sergey-miryanov sergey-miryanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@vstinner vstinner merged commit 313145e into python:main Oct 27, 2025
51 checks passed
@vstinner vstinner deleted the faulthandler_thread_name_windows branch October 27, 2025 17:41
@vstinner
Copy link
Member Author

vstinner commented Oct 27, 2025

Ok, let's see how it goes. Merged, thanks for reviews.

I'm not confident in this code, so I prefer to not backport it to 3.14.1. Also, it can be seen as a new feature rather than a bugfix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants