This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 1/2] Refactor sigcontextinfo.h


* Adhemerval Zanella:

>> Oh, right.  Wouldn't raise.c have to be compiled in this way?
>
> It is not strictly necessary for the test, since it will hit the expected PC 
> just before the raise call. However on some ABIs, sparc for instance,
> backtrace stops right before the raise call.

Hmm.  That's strange.  Maybe that's because there's a trampoline that
requires unwinding tables?

>> (We should really build all of glibc with asynchronous unwind tables.)
>
> Does libgcc_s require asynchronous unwind tables to correctly unwind? Or does
> it need just for PTHREAD_CANCEL_ASYNCHRONOUS, where the unwind happens in the
> signal handler instead of the syscall entry?

I think this is highly architecture-specific.  There are architecture
defaults if there are no unwind tables (some assume a frame pointer,
some assume a leaf function without any stack adjustments).  In general,
I suspect that on many architectures, unwind tables are required for
unwinding.  Distributions really should build all system libraries with
unwind tables for that reason, but not all of them do, unfortunately.
(Building with -fexceptions also enables an equivalent of SafeSEH for
thread cancellation handling.  This is avoids potential exploits that
target the cancellation cleanup routine, which is relevant even if
pthread_cancel is never actually called.)

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]