NetBSD Problem Report #42309

From njoly@lanfeust.sis.pasteur.fr  Fri Nov 13 10:37:26 2009
Return-Path: <njoly@lanfeust.sis.pasteur.fr>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id C62CB63B844
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 13 Nov 2009 10:37:26 +0000 (UTC)
Message-Id: <20091113103723.7FFE3DC9B9@lanfeust.sis.pasteur.fr>
Date: Fri, 13 Nov 2009 11:37:23 +0100 (CET)
From: njoly@pasteur.fr
Reply-To: njoly@pasteur.fr
To: gnats-bugs@gnats.NetBSD.org
Subject: KASSERT with killing a stopped+traced process
X-Send-Pr-Version: 3.95

>Number:         42309
>Category:       kern
>Synopsis:       KASSERT with killing a stopped+traced process
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    rmind
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Nov 13 10:40:00 +0000 2009
>Closed-Date:    Sat Nov 14 19:07:48 +0000 2009
>Last-Modified:  Sat Mar 17 19:20:01 +0000 2012
>Originator:     Nicolas Joly
>Release:        NetBSD 5.99.22
>Organization:
Insitut Pasteur
>Environment:
System: NetBSD lanfeust.sis.pasteur.fr 5.99.22 NetBSD 5.99.22 (LANFEUST) #1: Fri Nov 13 11:06:23 CET 2009 njoly@lanfeust.sis.pasteur.fr:/local/src/NetBSD/obj.amd64/sys/arch/amd64/compile/LANFEUST amd64
Architecture: x86_64
Machine: amd64
>Description:
When trying to kill with SIGKILL a stopped which is traced ...
a DIAGNOSTIC kernel panics:

panic: kernel diagnostic assertion "(ksi->ksi_flags & KSI_QUEUED) == 0" failed:
file "/local/src/NetBSD/src/sys/kern/kern_sig.c", line 584
fatal breakpoint trap in supervisor mode
trap type 1 code 0 rip ffffffff802258d5 cs 8 rflags 246 cr2  575f84 cpl 0 rsp ff
ff80004a59b9e0
Stopped in pid 96.1 (zsh) at    netbsd:breakpoint+0x5:  leave
db{1}> bt
breakpoint() at netbsd:breakpoint+0x5
panic() at netbsd:panic+0x2a0
__kernassert() at netbsd:__kernassert+0x2d
sigput() at netbsd:sigput+0x12f
kpsignal2() at netbsd:kpsignal2+0x3a0
sys_kill() at netbsd:sys_kill+0x142
syscall() at netbsd:syscall+0xaa

njoly@lanfeust [netbsd/tmp]> cat ptrace.c 
#include <sys/types.h>
#include <sys/ptrace.h>
#include <err.h>
#include <stdlib.h>
#include <signal.h>

int main() {
  int res;

  warnx("%d", getpid());

  res = ptrace(PT_TRACE_ME, 0, NULL, 0);
  if (res == -1)
    err(1, "ptrace failed");

  raise(SIGSTOP);

  return 0; }
njoly@lanfeust [netbsd/tmp]> make ptrace
cc -O2   -o ptrace ptrace.c 
njoly@lanfeust [netbsd/tmp]> ./ptrace   
ptrace: 753
zsh: suspended (signal)  ./ptrace
njoly@lanfeust [netbsd/tmp]> kill -9 753
[...PANIC...]

>How-To-Repeat:
Issue a SIGKILL to a stopped+traced process.
>Fix:
please.

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->rmind
Responsible-Changed-By: rmind@NetBSD.org
Responsible-Changed-When: Sat, 14 Nov 2009 16:10:23 +0000
Responsible-Changed-Why:
Take.


From: Mindaugas Rasiukevicius <rmind@netbsd.org>
To: njoly@pasteur.fr
Cc: gnats-bugs@NetBSD.org, netbsd-bugs@netbsd.org, gnats-admin@netbsd.org
Subject: Re: kern/42309 (KASSERT with killing a stopped+traced process)
Date: Sat, 14 Nov 2009 16:06:00 +0000

 Hello,

 > >Number:         42309
 > >Category:       kern
 > >Synopsis:       KASSERT with killing a stopped+traced process
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       medium
 > >Responsible:    kern-bug-people
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Fri Nov 13 10:40:00 +0000 2009
 > >Originator:     Nicolas Joly
 > >Release:        NetBSD 5.99.22

 This patch fixes the problem:

 http://www.netbsd.org/~rmind/sig_traced.diff

 -- 
 Mindaugas

From: Nicolas Joly <njoly@pasteur.fr>
To: Mindaugas Rasiukevicius <rmind@netbsd.org>
Cc: njoly@pasteur.fr, gnats-bugs@NetBSD.org, netbsd-bugs@netbsd.org,
	gnats-admin@netbsd.org
Subject: Re: kern/42309 (KASSERT with killing a stopped+traced process)
Date: Sat, 14 Nov 2009 19:13:22 +0100

 On Sat, Nov 14, 2009 at 04:06:00PM +0000, Mindaugas Rasiukevicius wrote:
 > Hello,
 > 
 > > >Number:         42309
 > > >Category:       kern
 > > >Synopsis:       KASSERT with killing a stopped+traced process
 > > >Confidential:   no
 > > >Severity:       serious
 > > >Priority:       medium
 > > >Responsible:    kern-bug-people
 > > >State:          open
 > > >Class:          sw-bug
 > > >Submitter-Id:   net
 > > >Arrival-Date:   Fri Nov 13 10:40:00 +0000 2009
 > > >Originator:     Nicolas Joly
 > > >Release:        NetBSD 5.99.22
 > 
 > This patch fixes the problem:
 > 
 > http://www.netbsd.org/~rmind/sig_traced.diff

 It does, thanks.

 -- 
 Nicolas Joly

 Biological Software and Databanks.
 Institut Pasteur, Paris.

State-Changed-From-To: open->closed
State-Changed-By: rmind@NetBSD.org
State-Changed-When: Sat, 14 Nov 2009 19:07:48 +0000
State-Changed-Why:
Fixed, thanks.


From: Mindaugas Rasiukevicius <rmind@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/42309 CVS commit: src/sys/kern
Date: Sat, 14 Nov 2009 19:06:55 +0000

 Module Name:	src
 Committed By:	rmind
 Date:		Sat Nov 14 19:06:55 UTC 2009

 Modified Files:
 	src/sys/kern: kern_sig.c

 Log Message:
 kpsignal2: do not make the signal pending twice when tracing the process,
 also update a comment and add an assert.  Fixes PR/42309 by Nicolas Joly.


 To generate a diff of this commit:
 cvs rdiff -u -r1.299 -r1.300 src/sys/kern/kern_sig.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Manuel Bouyer" <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/42309 CVS commit: [netbsd-5] src/sys/kern
Date: Sat, 17 Mar 2012 19:14:10 +0000

 Module Name:	src
 Committed By:	bouyer
 Date:		Sat Mar 17 19:14:10 UTC 2012

 Modified Files:
 	src/sys/kern [netbsd-5]: kern_sig.c

 Log Message:
 Pull up following revision(s) (requested by christos in ticket #1741):
 	sys/kern/kern_sig.c: revision 1.300
 kpsignal2: do not make the signal pending twice when tracing the process,
 also update a comment and add an assert.  Fixes PR/42309 by Nicolas Joly.


 To generate a diff of this commit:
 cvs rdiff -u -r1.289.4.7 -r1.289.4.8 src/sys/kern/kern_sig.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Manuel Bouyer" <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/42309 CVS commit: [netbsd-5-0] src/sys/kern
Date: Sat, 17 Mar 2012 19:14:15 +0000

 Module Name:	src
 Committed By:	bouyer
 Date:		Sat Mar 17 19:14:15 UTC 2012

 Modified Files:
 	src/sys/kern [netbsd-5-0]: kern_sig.c

 Log Message:
 Pull up following revision(s) (requested by christos in ticket #1741):
 	sys/kern/kern_sig.c: revision 1.300
 kpsignal2: do not make the signal pending twice when tracing the process,
 also update a comment and add an assert.  Fixes PR/42309 by Nicolas Joly.


 To generate a diff of this commit:
 cvs rdiff -u -r1.289.4.5.2.1 -r1.289.4.5.2.2 src/sys/kern/kern_sig.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Manuel Bouyer" <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/42309 CVS commit: [netbsd-5-1] src/sys/kern
Date: Sat, 17 Mar 2012 19:15:13 +0000

 Module Name:	src
 Committed By:	bouyer
 Date:		Sat Mar 17 19:15:12 UTC 2012

 Modified Files:
 	src/sys/kern [netbsd-5-1]: kern_sig.c

 Log Message:
 Pull up following revision(s) (requested by christos in ticket #1741):
 	sys/kern/kern_sig.c: revision 1.300
 kpsignal2: do not make the signal pending twice when tracing the process,
 also update a comment and add an assert.  Fixes PR/42309 by Nicolas Joly.


 To generate a diff of this commit:
 cvs rdiff -u -r1.289.4.6 -r1.289.4.6.2.1 src/sys/kern/kern_sig.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.