From: Andrew Deason Date: Tue, 20 Oct 2009 17:43:42 +0000 (-0500) Subject: HPUX: Do not sigwait on critical signals X-Git-Tag: openafs-devel-1_5_66~22 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=bf9c51a4e13b3e621b99866e9be53c8fe35a39fe;p=packages%2Fo%2Fopenafs.git HPUX: Do not sigwait on critical signals On HPUX, it is possible for 'critical' signals such as SEGV, ABRT, etc to be delivered to the softsig thread when we sigwait(). The current code marks these as 'fatal' and just exit(0)s when they are received, preventing us from getting cores in the case of a SEGV, ABRT, etc. To work around this and keep behavior on other platforms the same, just do not wait on 'critical' signals on HPUX in the softsig thread. Reviewed-on: http://gerrit.openafs.org/693 Tested-by: Andrew Deason Reviewed-by: Derrick Brashear --- diff --git a/src/util/softsig.c b/src/util/softsig.c index bcd04f9e9..4c202b9f9 100644 --- a/src/util/softsig.c +++ b/src/util/softsig.c @@ -57,7 +57,12 @@ softsig_thread(void *arg) #if defined(AFS_DARWIN60_ENV) || (defined(AFS_NBSD_ENV) && !defined(AFS_NBSD50_ENV)) pthread_sigmask (SIG_BLOCK, &ss, NULL); sigdelset (&os, SIGUSR1); -#else /* !defined(AFS_DARWIN60_ENV) && !defined(AFS_NBSD_ENV) */ +#elif !defined(AFS_HPUX_ENV) + /* On HPUX, don't wait for 'critical' signals, as things such as + * SEGV won't cause a core, then. Some non-HPUX platforms may need + * this, though, since apparently if we wait on some signals but not + * e.g. SEGV, the softsig thread will still wait around when the + * other threads were killed by the SEGV. */ for (i = 0; i < NSIG; i++) { if (!sigismember(&os, i) && i != SIGSTOP && i != SIGKILL) { sigaddset(&ss, i);