This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
RFA: Need to extend x86 psABI to support thread cancellation and alternate signal stack
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>, GCC Development <gcc at gcc dot gnu dot org>, "Carlos O'Donell" <carlos at redhat dot com>
- Date: Mon, 26 Mar 2018 15:43:20 -0700
- Subject: RFA: Need to extend x86 psABI to support thread cancellation and alternate signal stack
On Linux, when alternate signal stack is used with thread cancellation,
_Unwind_Resume fails when it tries to unwind shadow stack from signal
handler on alternate signal stack. The issue is that signal handler on
alternate signal stack uses a separate shadow stack and we must switch
to the original shadow stack to unwind it. But frame count will be wrong
in this case. For thread cancellation, there is no need to unwind shadow
stack since it will long jump back and exit.
One possibility is
1. Add _URC_NO_REASON_CANCEL.
2. unwind_stop in libpthread returns _URC_NO_REASON_CANCEL.
3. _Unwind_ForcedUnwind_Phase2 sets frames to 1 for
_URC_NO_REASON_CANCEL
BTW, I opened:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85086
--
H.J.