-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
TLS accesses aren't async-signal-safe #43146
Comments
Can we get the data from what the OS passes to the signal handler? |
Would it be possible to not use the stdlib TLS mechanisms and instead implement a custom TLS access mechanism? |
@DemiMarie oh the problem is that we currently use two thread-local pieces of information in the signal handler: the thread's name and the thread's guard page. We use the latter for determining whether we should print anything at all and the former for a nicer error message. Unfortunately the OS doesn't pass either of these to the signal handler, but we do currently extract the segfaulting address from the signal handler. @joshlf AFAIK APIs like |
Closing in favour of #133698. |
On many Unix platforms we install a signal handler for SIGSEGV/SIGBUS to catch stack overflow. This starts off by accessing the thread-local stack guard which in turn will access a
thread_local!
. Unfortunately, though,thread_local!
is not async-signal-safe due to a number of reasons:with
function can panic.Unfortunately I don't really know the best way to solve this...
The text was updated successfully, but these errors were encountered: