[PATCH 0/2] nptl: Update struct pthread_unwind_buf

H.J. Lu hjl.tools@gmail.com
Sun Feb 25 13:36:00 GMT 2018


On Sun, Feb 25, 2018 at 4:58 AM, Florian Weimer <fw@deneb.enyo.de> wrote:
> * H. J. Lu:
>
>> Let me rephrase.  Can a function, which contains cancellation points,
>> return to its caller after cancellation happened?
>
> I don't think it can.  It's undefined to use longjmp to jump out of a
> cancellation handler.  On the C++ side, we make sure that the
> unwinding always proceeds, even across catch (...) blocks which
> swallow the exception.

libpthread cancellation implementation passes cancel_jmp_buf to
libgcc unwinder, which saves and restores shadow stack register
for C++ exception.  How can libgcc unwinder tell when to save and
restore shadow stack register?

-- 
H.J.



More information about the Libc-alpha mailing list