]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
HPUX: Do not sigwait on critical signals
authorAndrew Deason <adeason@sinenomine.net>
Tue, 20 Oct 2009 17:43:42 +0000 (12:43 -0500)
committerDerrick Brashear <shadow|account-1000005@unknown>
Wed, 21 Oct 2009 20:24:17 +0000 (13:24 -0700)
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 <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit bf9c51a4e13b3e621b99866e9be53c8fe35a39fe)
Reviewed-on: http://gerrit.openafs.org/702

src/util/softsig.c

index 33981b870e6fe5a23f2791f025139967b1264da3..0ad2482a1c78420ca544e75bc4a580440241748b 100644 (file)
@@ -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);