public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* RFA: Need to extend x86 psABI to support thread cancellation and alternate signal stack
@ 2018-03-26 22:43 H.J. Lu
  2018-03-27  6:31 ` Florian Weimer
  0 siblings, 1 reply; 6+ messages in thread
From: H.J. Lu @ 2018-03-26 22:43 UTC (permalink / raw)
  To: GNU C Library, GCC Development, Carlos O'Donell

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-03-28 13:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-26 22:43 RFA: Need to extend x86 psABI to support thread cancellation and alternate signal stack H.J. Lu
2018-03-27  6:31 ` Florian Weimer
2018-03-27 11:26   ` H.J. Lu
2018-03-27 15:43     ` Florian Weimer
2018-03-27 15:55       ` H.J. Lu
2018-03-28 13:04         ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).