From owner-freebsd-bugs Sun Oct 13 8:10: 7 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1A48837B401 for ; Sun, 13 Oct 2002 08:10:04 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4C24743E8A for ; Sun, 13 Oct 2002 08:10:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9DFA3Co063678 for ; Sun, 13 Oct 2002 08:10:03 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9DFA3vA063677; Sun, 13 Oct 2002 08:10:03 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 383A037B401 for ; 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 ; 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 ; 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 ; 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 Reply-To: Mark Kettenis To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/44010: [PATCH] SIGCONT isn't reported for traced processes Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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