Date: Thu, 27 Feb 2003 01:10:03 +1100 From: Tim Robbins <tjr@FreeBSD.ORG> To: Mike Makonnen <mtm@identd.net> Cc: julian@FreeBSD.ORG, freebsd-current@FreeBSD.ORG Subject: Re: signals still broken ? Message-ID: <20030227011003.A53053@dilbert.robbins.dropbear.id.au> In-Reply-To: <20030226112543.ISTQ16831.out001.verizon.net@kokeb.ambesa.net>; from mtm@identd.net on Wed, Feb 26, 2003 at 06:25:39AM -0500 References: <20030226112543.ISTQ16831.out001.verizon.net@kokeb.ambesa.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Feb 26, 2003 at 06:25:39AM -0500, Mike Makonnen wrote:
> The following program is stuck in pause(3) forever. I have reproduced the bug in
> 5.0-RELEASE, but 4.7-STABLE behaves as expected: the child resumes upon
> receiving SIGCONT.
I spent a while trying to decipher the 5.x signal code and I think I have
spotted the code responsible for the difference in behaviour between
5.x and 4.7. The difference is that 5.x drops SIGCONT when the process
is already "active" even when a handler is installed for that signal.
Here is a patch to try:
Do not drop SIGCONT signals when a process is not stopped and has
installed a handler for that signal.
Index: kern_sig.c
===================================================================
RCS file: /x/freebsd/src/sys/kern/kern_sig.c,v
retrieving revision 1.210
diff -u -r1.210 kern_sig.c
--- kern_sig.c 17 Feb 2003 09:58:11 -0000 1.210
+++ kern_sig.c 26 Feb 2003 13:41:01 -0000
@@ -1483,10 +1483,7 @@
* eventually hit thread_suspend_check().
*/
} else if (p->p_state == PRS_NORMAL) {
- if (prop & SA_CONT) {
- /*
- * Already active, don't need to start again.
- */
+ if ((prop & SA_CONT) && action == SIG_DFL) {
SIGDELSET(p->p_siglist, sig);
goto out;
}
With this patch applied, your test program seems to work properly except
that wait() is called incorrectly (1st arg should be a pointer):
$ ./a.out
sleeping 3s
waiting
a.out: wait(): Bad address
Let me know whether it works for you.
Tim
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030227011003.A53053>
