From owner-freebsd-current Sun Aug 4 13:10:30 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id NAA20997 for current-outgoing; Sun, 4 Aug 1996 13:10:30 -0700 (PDT) Received: from austin.polstra.com (austin.polstra.com [206.213.73.10]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id NAA20992 for ; Sun, 4 Aug 1996 13:10:27 -0700 (PDT) Received: from austin.polstra.com (jdp@localhost) by austin.polstra.com (8.7.5/8.7.3) with ESMTP id NAA10207 for ; Sun, 4 Aug 1996 13:10:26 -0700 (PDT) Message-Id: <199608042010.NAA10207@austin.polstra.com> To: freebsd-current@freebsd.org Subject: Bug: Signal handler won't stay installed Date: Sun, 04 Aug 1996 13:10:26 -0700 From: John Polstra Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I've run into what looks like a kernel bug in a -current system from around July 20th. My program (the CVSup server daemon) sets up a signal handler for the SIGCHLD signal, using sigaction(). The signal handler does the usual thing to reap child processes that have exited. Namely, it loops calling wait3() with the WNOHANG flag set, until -1 is returned. The handler function gets called the first time a SIGCHLD happens, but subsequent SIGCHLDs are ignored. The signals don't show up in ktrace output at all, and the child processes stick around in the zombie state. This happens only on my -current system; it works fine on several -stable systems I've tried. The signal handler that was installed by sigaction should remain installed after the handler function has returned. I.e., it should be able to catch repeated signals without having to call sigaction each time. As a work-around, I tried calling sigaction() from within the handler function each time, just before it returns. That fixed the problem. But it should not be necessary. My struct sigaction has sa_mask=0 and sa_flags=SA_NOCLDSTOP. Do any of you have any ideas about this? I can put together a stand-alone test case, if necessary. -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Self-knowledge is always bad news." -- John Barth