Date: Sun, 04 Aug 1996 13:10:26 -0700 From: John Polstra <jdp@polstra.com> To: freebsd-current@freebsd.org Subject: Bug: Signal handler won't stay installed Message-ID: <199608042010.NAA10207@austin.polstra.com>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199608042010.NAA10207>