From kettenis@elgar.kettenis.dyndns.org  Sun Oct 13 08:06:36 2002
Return-Path: <kettenis@elgar.kettenis.dyndns.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 383A037B401
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 13 Oct 2002 08:06:36 -0700 (PDT)
Received: from walton.kettenis.dyndns.org (a169250.upc-a.chello.nl [62.163.169.250])
	by mx1.FreeBSD.org (Postfix) with ESMTP id CE4B943E97
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 13 Oct 2002 08:06:33 -0700 (PDT)
	(envelope-from kettenis@elgar.kettenis.dyndns.org)
Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2])
	by walton.kettenis.dyndns.org (8.12.5/8.12.5) with ESMTP id g9DF6QQW000732
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 13 Oct 2002 17:06:26 +0200 (CEST)
	(envelope-from kettenis@elgar.kettenis.dyndns.org)
Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1])
	by elgar.kettenis.dyndns.org (8.12.6/8.12.6) with ESMTP id g9DF6QKa000612
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 13 Oct 2002 17:06:26 +0200 (CEST)
	(envelope-from kettenis@elgar.kettenis.dyndns.org)
Received: (from kettenis@localhost)
	by elgar.kettenis.dyndns.org (8.12.6/8.12.6/Submit) id g9DF6PvN000611;
	Sun, 13 Oct 2002 17:06:25 +0200 (CEST)
Message-Id: <200210131506.g9DF6PvN000611@elgar.kettenis.dyndns.org>
Date: Sun, 13 Oct 2002 17:06:25 +0200 (CEST)
From: Mark Kettenis <kettenis@chello.nl>
Reply-To: Mark Kettenis <kettenis@chello.nl>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] SIGCONT isn't reported for traced processes
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         44010
>Category:       kern
>Synopsis:       [PATCH] SIGCONT isn't reported for traced processes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 13 08:10:01 PDT 2002
>Closed-Date:    Sat Apr 12 10:53:54 PDT 2003
>Last-Modified:  Sat Apr 12 10:53:54 PDT 2003
>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:

From: Mark Kettenis <kettenis@chello.nl>
To: freebsd-gnats-submit@FreeBSD.org, kettenis@chello.nl
Cc:  
Subject: Re: kern/44010: [PATCH] SIGCONT isn't reported for traced processes
Date: Sat, 12 Apr 2003 19:12:13 +0200 (CEST)

 This bug has been fixed, presumably since revision 1.211 of
 /usr/src/sys/kern/ker_sig.c.  Feel free to close this bug report.
 
 Mark
State-Changed-From-To: open->closed 
State-Changed-By: maxim 
State-Changed-When: Sat Apr 12 10:53:08 PDT 2003 
State-Changed-Why:  
Fixed in rev. 1.211 src/sys/kern/kern_sig.c, thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=44010 
>Unformatted:
