-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
gh-125434: Display thread name in faulthandler on Windows #140675
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
gh-125434: Display thread name in faulthandler on Windows #140675
Conversation
serhiy-storchaka
left a comment
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.
LGTM. 👍
|
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. |
sergey-miryanov
left a comment
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.
LGTM. Thanks!
|
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. |
…on#140675) (cherry picked from commit 313145e)
…2011) * gh-125434: Display thread name in faulthandler on Windows (#140675) (cherry picked from commit 313145e) * gh-125434: Fix non-ASCII thread names in faulthandler on Windows (#140700) Add _Py_DumpWideString() function to dump a wide string as ASCII. It supports surrogate pairs. Replace _Py_EncodeLocaleRaw() with _Py_DumpWideString() in write_thread_name(). (cherry picked from commit 80f20f5)
Uh oh!
There was an error while loading. Please reload this page.