Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Oct 2002 17:06:25 +0200 (CEST)
From:      Mark Kettenis <kettenis@chello.nl>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/44010: [PATCH] SIGCONT isn't reported for traced processes
Message-ID:  <200210131506.g9DF6PvN000611@elgar.kettenis.dyndns.org>

next in thread | raw e-mail | index | archive | help

>Number:         44010
>Category:       kern
>Synopsis:       [PATCH] SIGCONT isn't reported for traced processes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 13 08:10:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Mark Kettenis
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD elgar.kettenis.dyndns.org 5.0 CURRENT FreeBSD 5.0-CURRENT #7: Sun Oct 13 15:15:19 CEST 2002 kettenis@elgar.kettenis.dyndns.org:/usr/obj/usr/src/sys/GENERIC i386

>Description:
There's a bug in -CURRENT which results in SIGCONT never
being reported to the parent of a traced process.

>How-To-Repeat:
This problem can be seen by running the GDB testsuite,
where the following failure is encountered:

   FAIL: gdb.base/sigall.exp: get signal CONT

You'll see more FAILs as fall out from this first failure.  The
problem is a regression with respect to -STABLE.

>Fix:
The problem lies within psignal(), where a signal that has the
SA_CONT property is cleared regardless whether the process is traced
or not.  The attached patch fixes the problem by not clearing the
signal if the process is traced.  This patch is against version 1.196
of kern_sig.c.

This patch is also available as:

   http://members.chello.nl/~m.m.kettenis/FreeBSD/5-current/ptrace.patch.

--- /usr/src/sys/kern/kern_sig.c.orig	Wed Oct  2 11:08:11 2002
+++ /usr/src/sys/kern/kern_sig.c	Sun Oct 13 15:42:09 2002
@@ -1433,7 +1433,7 @@ psignal(p, sig)
 		 * eventually hit thread_suspend_check().
 		 */
 	}  else if (p->p_state == PRS_NORMAL) {
-		if (prop & SA_CONT) {
+		if ((prop & SA_CONT) && (p->p_flag & P_TRACED) == 0) {
 			/*
 			 * Already active, don't need to start again.
 			 */

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210131506.g9DF6PvN000611>