NetBSD Problem Report #46038

From www@NetBSD.org  Fri Feb 17 10:10:51 2012
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id 9D50463E0AC
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 17 Feb 2012 10:10:51 +0000 (UTC)
Message-Id: <20120217101050.D2AE563DFA1@www.NetBSD.org>
Date: Fri, 17 Feb 2012 10:10:50 +0000 (UTC)
From: uklaus@hgb-leipzig.de
Reply-To: uklaus@hgb-leipzig.de
To: gnats-bugs@NetBSD.org
Subject: make test in /usr/pkgsrc/devel/m4 causes kernel panic
X-Send-Pr-Version: www-1.0

>Number:         46038
>Category:       kern
>Synopsis:       make test in /usr/pkgsrc/devel/m4 causes kernel panic
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    martin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 17 10:15:00 +0000 2012
>Closed-Date:    Tue Feb 21 16:03:11 +0000 2012
>Last-Modified:  Tue Feb 21 16:03:11 +0000 2012
>Originator:     Uwe Klaus
>Release:        6.0_BETA
>Organization:
>Environment:
NetBSD x201 6.0_BETA NetBSD 6.0_BETA (GENERIC) #1: Fri Feb 17 10:08:06 CET 2012  root@x201:/usr/obj.amd64/sys/arch/amd64/compile/GENERIC amd64
>Description:
make test in /usr/pkgsrc/devel/m4 causes kernel panic
in src/sys/kern/subr_kmem.c line 170

>How-To-Repeat:
cd /usr/pkgsrc/devel/m4
make
make test

>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->martin
Responsible-Changed-By: martin@NetBSD.org
Responsible-Changed-When: Fri, 17 Feb 2012 19:42:49 +0000
Responsible-Changed-Why:
my fault


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/46038 CVS commit: src/sys/kern
Date: Mon, 20 Feb 2012 12:19:56 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Mon Feb 20 12:19:56 UTC 2012

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

 Log Message:
 More posix_spawn fallout:
 Fix a kmem_alloc() call with zero size (PR kern/46038), allow file actions
 to be passed, even if empty.
 Rearange p_reflock locking for the child, avoid a double free in an
 error case, avoid a memory leak in another error case - all pointed out
 by yamt.
 During blocking operations early in the child borrow the kernel vmspace
 (as suggested by yamt).


 To generate a diff of this commit:
 cvs rdiff -u -r1.340 -r1.341 src/sys/kern/kern_exec.c

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

State-Changed-From-To: open->feedback
State-Changed-By: martin@NetBSD.org
State-Changed-When: Mon, 20 Feb 2012 12:24:28 +0000
State-Changed-Why:
This should now be fixed, can you please confirm?


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/46038 CVS commit: src/tests/lib/libc/gen/posix_spawn
Date: Mon, 20 Feb 2012 12:22:40 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Mon Feb 20 12:22:40 UTC 2012

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

 Log Message:
 Add a test case to call posix_spawn with empty file actions, which reproduced
 the (now fixed) PR kern/46038.


 To generate a diff of this commit:
 cvs rdiff -u -r1.2 -r1.3 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.

From: Uwe Klaus <uklaus@hgb-leipzig.de>
To: gnats-bugs@NetBSD.org
Cc: martin@NetBSD.org, netbsd-bugs@NetBSD.org, gnats-admin@NetBSD.org,
        martin@NetBSD.org
Subject: Re: kern/46038 (make test in /usr/pkgsrc/devel/m4 causes kernel
 panic)
Date: Mon, 20 Feb 2012 16:41:52 +0100 (CET)

 On Mon, 20 Feb 2012, martin@NetBSD.org wrote:

 > Synopsis: make test in /usr/pkgsrc/devel/m4 causes kernel panic
 >
 > State-Changed-From-To: open->feedback
 > State-Changed-By: martin@NetBSD.org
 > State-Changed-When: Mon, 20 Feb 2012 12:24:28 +0000
 > State-Changed-Why:
 > This should now be fixed, can you please confirm?
 partially.

 make test succeeds for WRKOBJDIR on ffs file systems, but not for
 WRKOBJDIR on tmpfs (kernel still reboots: src/sys/fs/tmpfs/tmpfs_vnops.c, 
 line 2093) after PASS test-rename.

 mk.conf:    WRKOBJDIR=/tmp/pkgsrc
 /etc/fstab: tmpfs /tmp tmpfs rw,-s=2G,nodev,nosuid


From: Martin Husemann <martin@duskware.de>
To: Uwe Klaus <uklaus@hgb-leipzig.de>
Cc: gnats-bugs@NetBSD.org, dh@NetBSD.org
Subject: Re: kern/46038 (make test in /usr/pkgsrc/devel/m4 causes kernel panic)
Date: Mon, 20 Feb 2012 18:16:33 +0100

 On Mon, Feb 20, 2012 at 04:41:52PM +0100, Uwe Klaus wrote:
 > WRKOBJDIR on tmpfs (kernel still reboots: src/sys/fs/tmpfs/tmpfs_vnops.c, 
 > line 2093) after PASS test-rename.

 That looks like a completely different bug now. Probably better to track
 that separately, would you mind opening another PR, then I'll close
 this one?

 Thanks,

 Martin

From: "Stephen Borrill" <sborrill@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/46038 CVS commit: [netbsd-6] src
Date: Mon, 20 Feb 2012 21:54:58 +0000

 Module Name:	src
 Committed By:	sborrill
 Date:		Mon Feb 20 21:54:57 UTC 2012

 Modified Files:
 	src/include [netbsd-6]: spawn.h
 	src/sys/kern [netbsd-6]: kern_exec.c
 	src/sys/uvm [netbsd-6]: uvm_glue.c
 	src/tests/lib/libc/gen/posix_spawn [netbsd-6]: t_fileactions.c

 Log Message:
 Pull up the following revisions(s) (requested by martin in ticket #14):
 	include/spawn.h:		revision 1.2
 	sys/kern/kern_exec.c:		revision 1.341
 	sys/uvm/uvm_glue.c:		revision 1.157
 	tests/lib/libc/gen/posix_spawn/t_fileactions.c:	revision 1.3

 posix_spawn: fix kernel bug when passing empty fileactions (PR kern/46038)
 and add a test case for this.  Fix potential race condition, doublefreeing
 of memory and memory leaks in error cases.


 To generate a diff of this commit:
 cvs rdiff -u -r1.1 -r1.1.2.1 src/include/spawn.h
 cvs rdiff -u -r1.339 -r1.339.2.1 src/sys/kern/kern_exec.c
 cvs rdiff -u -r1.156 -r1.156.2.1 src/sys/uvm/uvm_glue.c
 cvs rdiff -u -r1.2 -r1.2.2.1 \
     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.

From: Uwe Klaus <uklaus@hgb-leipzig.de>
To: Martin Husemann <martin@duskware.de>
Cc: gnats-bugs@NetBSD.org, dh@NetBSD.org
Subject: Re: kern/46038 (make test in /usr/pkgsrc/devel/m4 causes kernel
 panic)
Date: Tue, 21 Feb 2012 12:17:51 +0100 (CET)

 On Mon, 20 Feb 2012, Martin Husemann wrote:

 >> WRKOBJDIR on tmpfs (kernel still reboots: src/sys/fs/tmpfs/tmpfs_vnops.c,
 >> line 2093) after PASS test-rename.
 >
 > That looks like a completely different bug now. Probably better to track
 > that separately, would you mind opening another PR, then I'll close
 > this one?
 O.K.

 Thanks,
 U. Klaus

State-Changed-From-To: feedback->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Tue, 21 Feb 2012 16:03:11 +0000
State-Changed-Why:
Initial bug fixed and fix pulled up, also test case added.
There is another bug (unrelated), submitter will provide new PR for that.
Thanks for the bug report and testing!


>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.