NetBSD Problem Report #45991

From tsutsui@ceres.dti.ne.jp  Sun Feb 12 04:33:55 2012
Return-Path: <tsutsui@ceres.dti.ne.jp>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id D5AEC63B86B
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 12 Feb 2012 04:33:55 +0000 (UTC)
Message-Id: <201202120433.q1C4XqhW005238@mirage.localdomain>
Date: Sun, 12 Feb 2012 13:33:52 +0900 (JST)
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Reply-To: tsutsui@ceres.dti.ne.jp
To: gnats-bugs@gnats.NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: posix_spawn causes panic
X-Send-Pr-Version: 3.95

>Number:         45991
>Category:       kern
>Synopsis:       posix_spawn causes panic
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    martin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 12 04:35:00 +0000 2012
>Closed-Date:    Mon Feb 13 14:46:51 +0000 2012
>Last-Modified:  Tue Feb 14 00:15:02 +0000 2012
>Originator:     Izumi Tsutsui
>Release:        NetBSD 5.99.65 updated around 201202120100Z
>Organization:
>Environment:
System: NetBSD 5.99.65 GENERIC built by build.sh release
Architecture: i386
Machine: i386
On old PentiumM uniprocessor PC
>Description:
configure check against posix_spawn in pkgsrc/devel/m4 causes kernel panic:
---
 :
checking for promoted mode_t type... mode_t
checking for posix_spawn works... fatal page fault in supervisor mode
trap type 6 code 0 eip c06abe6f cs 8 eflags 10246 cr2 0 ilevel 0
kernel: supervisor trap page fault, code=0
Stopped in pid 11336.1 (conftest) at	netbsd:pmap_deactivate+0x74:	movl	0
(%eax),%ebx
db{0}> tr
pmap_deactivate(c3411aa0,0,dba16c8c,,c3417054,c3411aa0,906,c3417054,93a97b98,0,c3417054) at netbsd:pmap_deactivate+0x74
uvm_proc_exit(c340188c,0,dba16c8c,c3411800,c0c5e800,c1889240,dba16c6c,c057949f,dba16c8c,2) at netbsd:uvm_proc_exit+0x3f
exit1(c3411aa0,906,0,0,dba16d0c,c0c5e800,c3411aa0,c340188c,0,c1aec658) at netbsd:exit1+0x187
spawn_return(c1af6c40,b3,ab,bfbf001f,bb91001f,bfbfe190,0,bfbfe1c4,80490ec,bb906040) at netbsd:spawn_return+0x559
db{0}>
---

(typed from screen, sorry if any typo)

>How-To-Repeat:
install 5.99.65 via sysinst
get and extract pkgsrc-2011Q4.tar.xz tree
cd pkgsrc/devel/m4 ; make update

>Fix:
Prepare proper tests?

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->martin
Responsible-Changed-By: martin@NetBSD.org
Responsible-Changed-When: Sun, 12 Feb 2012 08:06:52 +0000
Responsible-Changed-Why:
My fault - looking at it.


State-Changed-From-To: open->analyzed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Sun, 12 Feb 2012 08:46:36 +0000
State-Changed-Why:
A "if (p->p_vmspace != NULL)" got lost during merge, but it is not yet
clear to me, why the tests don't trigger this failure as well.


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45991 CVS commit: src/sys/uvm
Date: Sun, 12 Feb 2012 11:18:05 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sun Feb 12 11:18:05 UTC 2012

 Modified Files:
 	src/sys/uvm: uvm_glue.c

 Log Message:
 In uvm_proc_exit bail out early if we have no vmspace yet (as it happens
 for failing posix_spawn child processes).
 Fixes PR kern/45991.


 To generate a diff of this commit:
 cvs rdiff -u -r1.155 -r1.156 src/sys/uvm/uvm_glue.c

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

State-Changed-From-To: analyzed->feedback
State-Changed-By: martin@NetBSD.org
State-Changed-When: Sun, 12 Feb 2012 13:17:42 +0000
State-Changed-Why:
The configure test now works for me, improved tests will follow soon.
Does it work for you as well?


From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@NetBSD.org
Cc: martin@NetBSD.org, tsutsui@ceres.dti.ne.jp
Subject: Re: kern/45991 (posix_spawn causes panic)
Date: Sun, 12 Feb 2012 23:57:27 +0900

 > The configure test now works for me, improved tests will follow soon.
 > Does it work for you as well?

 Still gets panic on i386:
 ---

 checking for promoted mode_t type... mode_t
 checking whether posix_spawn works... panic: kernel diagnostic assertion "kpreempt_disabled()" failed: file: "/s/src/sys/arch/x86/x86/pmap.c", line 2556
 fatal breakpoint trap in supervisor mode
 trap type 1 code 0 eip c026e884 cs 8 eflags 282 cr2 bb906010 ilevel 0
 Stopped in pid 13570.1 (conftest) at	netbsd:breakpoint+0x4:	popl	%ebp
 db{0}> tr
 breakpoint(c0c36fb1,c0cf6040,c0b8e410,d8aefbc8,c1827160,c2378730,0,c2368afc,c2378560,c2366524) at netbsd:breakpoint+0x4
 vpanic(c0b8e410,d8aefbc8,d8aefbbc,c057c9ad,0,bfc00000,d8aefbfc,c06abdca,c0b8e410,c0b8e5da) at netbsd:vpanic+0x1e2
 kern_assert(c0b8e410,c0b8e5da,c0bdc52e,c0c00a20,9fc,d8aefc9c,d8aefc2c,ffffffff,c23753c0,c24a6e40) at netbsd:kern_assert+0x23
 pmap_activate(c2378560,0,bfc00000,c07d12ce,6,c1b21c00,c0b7dfd8,c2378560,c2366524,0) at netbsd:pmap_activate+0x90
 execve_runproc(c0d183f4,0,180,d8aefd10,0,c1aec570,c0c5e800,d8aefcf4,c1af67c0,d8aefcf8) at netbsd:execve_runproc+0xe0
 spawn_return(c1af67c0,b3,ab,bfbf001f,bb91001f,bfbfe1e0,0,bfbfe210,80490ec,bb906040) at netbsd:spawn_return+0281
 db{0}>
 ---

 Typed from screen again. Should I prepare a machine with serial?

State-Changed-From-To: feedback->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Mon, 13 Feb 2012 14:46:51 +0000
State-Changed-Why:
confirmed to be fixed in private mail.
thanks for quick report and helpfull backtraces!


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45991 CVS commit: src/tests/lib/libc/gen/posix_spawn
Date: Tue, 14 Feb 2012 00:13:54 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Tue Feb 14 00:13:54 UTC 2012

 Modified Files:
 	src/tests/lib/libc/gen/posix_spawn: Makefile t_fileactions.c

 Log Message:
 Add a few more posix_spawn testcases, which should detect everything that
 was wrong in the initial version, causing the failure reported in
 PR kern/45991.


 To generate a diff of this commit:
 cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libc/gen/posix_spawn/Makefile \
     src/tests/lib/libc/gen/posix_spawn/t_fileactions.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.