Red Hat Bugzilla – Bug 109432
Race in pthreads signal handling
Last modified: 2016-11-24 09:58:19 EST
Description of problem:
There is a race of signal handling when a program is linked against
libpthreads (linuxthreads) on redhat linux <= 8.
In linuxthreads/signals.c: __sigaction(...)
if (__libc_sigaction(sig, newactp, oact) == -1)
__sighandler[sig].old = (arch_sighandler_t) act->sa_handler;
In linuxthreads/sighandler.c: __pthread_sighandler(...)
CALL_SIGHANDLER(__sighandler[signo].old, signo, ctx);
The problem is when SIG_DFL|SIG_IGN|SIG_ERR is the current handler,
and a new one is being installed. If the signal comes in after
__pthread_sighandler has been installed, but before
__sighandler[sig].old has been set, then __sighandler[sig].old == -1,
0, or 1, causing segfault when __pthread_sighandler() tries to invoke
it as a function.
A fix would be to make __pthread_sighandler() check it before
following it, or make __sigaction block/unblock the signal around the
Version-Release number of selected component:
Signals and LinuxThreads don't mix. There will always we problems.
Even if this specific problem is worked around this doesn't meant he
code will work 100%.
If you want to use signals, use NPTL. *Nothing* else is supported.
We are not using threads. But we use unixODBC, which links against
pthreads to get its mutex for locking. Just having pthreads linked in
cause it to take strong symbol for sigaction.
So our single-threaded IO dispatching process segfaults regularly on
all redhat versions with glibc-2.2.
Are there NTPL updates available for RH 8 and 7?
Should we be providing our own unixODBC which gives both -lodbc and
There will never be official NPTL support for RHL8 or earlier. If
somebody wants to try it, they are welcome.
Try the test release for the upcoming RHL8 errata at
and let us know whether it works or not.
Ping. Did you try the errata code? If I don't get any reply I'll
assume the problem is fixed.
Sorry - I had missed your comments.
We wait for info...
Seems to be working well in a test sandbox.
It has been hammered for 20 minutes (still ongoing). Prevous max was
around 15 seconds...
Is this errata coming soon? Any .src.rpms for them?
Any chances we can get the same pthread_sighandler fix from the
glibc-2.3 based errata into the glibc-2.2 based errata for RH 7?
Something similar to glibc-lt-sigaction.patch?
No RHL7.x version is supported anymore. Create your own binaries if