Red Hat Bugzilla – Bug 102998
nptl sigcancel_handler ignores context pointer [third argument]
Last modified: 2007-11-30 17:06:57 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030709
Description of problem:
The sigcancel_handler() in nptl/init.c does not use its third argument, void
*ctx, not even in the call to the __do_cancel() macro. Because of this, deeper
levels of the implementation of canceling (__pthread_unwind,
_Unwind_ForcedUnwind, MD_FALLBACK_FRAME_STATE_FOR, etc.) must assume where the
context is. Such assumptions easily can be incorrect, for example if the kernel
pushes the siginfo_t and struct ucontext onto the stack in the other order, or
not contiguously with the parameters to the handler [there might be alignment
Instead, sigcancel_handler should use the ctx argument, passing it along to
other levels, to allow intended flexibility of placement by the kernel, an
auditing subsystem, etc.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Inspect the source for sigcancel_handler in nptl/init.c, and __do_cancel in
Actual Results: The third argument to sigcancel_handler (the "void *ctx" which
on Linux/i386 is "struct ucontext *") is not used.
Expected Results: The void *ctx argument should be passed along for use by
deeper levels of the implementation of canceling.
MD_FALLBACK_FRAME_STATE_FOR is part of libgcc, not glibc and needs to be able
to unwind through any signal handler, not just SIGCANCEL in NPTL.
Alternative to MD_FALLBACK_FRAME_STATE_FOR is providing .eh_frame unwind
info for signal frames (e.g. in kernel virtual syscall page), but libgcc has
to support older kernels as well, so MD_FALLBACK_FRAME_STATE_FOR needs to stay