NetBSD Problem Report #46457
From www@NetBSD.org Wed May 16 08:37:07 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 895D263D3F2
for <gnats-bugs@gnats.NetBSD.org>; Wed, 16 May 2012 08:37:07 +0000 (UTC)
Message-Id: <20120516083706.A32CA63C785@www.NetBSD.org>
Date: Wed, 16 May 2012 08:37:06 +0000 (UTC)
From: naruse@airemix.jp
Reply-To: naruse@airemix.jp
To: gnats-bugs@NetBSD.org
Subject: pipe2 with O_CLOEXEC craches the system
X-Send-Pr-Version: www-1.0
>Number: 46457
>Category: kern
>Synopsis: pipe2 with O_CLOEXEC craches the system
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: martin
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed May 16 08:40:00 +0000 2012
>Closed-Date: Mon May 21 01:28:06 +0000 2012
>Last-Modified: Mon May 21 01:28:06 +0000 2012
>Originator: Yui NARUSE
>Release: 6.99.5
>Organization:
>Environment:
NetBSD kelvena.airemix.net 6.99.5 NetBSD 6.99.5 (GENERIC) #0: Fri Nov 18 08:35:28 JST 2011 naruse@kelvena.airemix.net:/usr/obj/sys/arch/amd64/compile/GENERIC amd64
>Description:
Consuming fds by pipe2(fildes, O_CLOEXEC) and exit,
it crashes the system.
>How-To-Repeat:
#include <stdio.h>
#include <fcntl.h>
int main(void)
{
int i;
for (i=0; i < 200; i++) {
int fildes[2];
if (pipe2(fildes, O_CLOEXEC) == -1) {
return 255;
}
}
return 0;
}
>Fix:
>Release-Note:
>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: kern/46457: pipe2 with O_CLOEXEC craches the system
Date: Wed, 16 May 2012 10:47:36 +0200
Reproducable in -current, it triggers:
panic: kernel diagnostic assertion "!ff->ff_exclose" failed: file "../../../../kern/kern_descrip.c", line 1561
with backtrace:
kern_assert(1756fd0, 1757008, 178e230, 178d890, 619, b) at netbsd:kern_assert+0x
34
fd_free(178dc20, 7ab3100, 7ab9000, 1884000, 178db80, 1756fd0) at netbsd:fd_free+
0x2b0
exit1(7291000, ff00, 1, 1, 0, 40415378) at netbsd:exit1+0xf8
sys_exit(7291000, 89c47dd0, 89c47e10, 1, ff7fffffffffffff, 40414f90) at netbsd:s
ys_exit+0x30
syscall_plain(89c47ed0, 89c47dd0, 40553248, ffffffffffffb041, 40553248, 1) at ne
tbsd:syscall_plain+0x110
Martin
From: "Jukka Ruohonen" <jruoho@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/46457 CVS commit: src/tests/lib/libc/sys
Date: Wed, 16 May 2012 09:06:35 +0000
Module Name: src
Committed By: jruoho
Date: Wed May 16 09:06:35 UTC 2012
Modified Files:
src/tests/lib/libc/sys: t_pipe2.c
Log Message:
Add a case for PR kern/46457. This is skipped for the time being, as it
reproduces the panic described in the PR.
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libc/sys/t_pipe2.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/46457 CVS commit: src/sys/kern
Date: Wed, 16 May 2012 09:41:11 +0000
Module Name: src
Committed By: martin
Date: Wed May 16 09:41:11 UTC 2012
Modified Files:
src/sys/kern: sys_pipe.c
Log Message:
Make sure we can deliver two file descriptors for pipe2() before we set
up anything special (like close on exec).
Fixes PR kern/46457.
To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/sys/kern/sys_pipe.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/46457 CVS commit: src/tests/lib/libc/sys
Date: Wed, 16 May 2012 09:51:59 +0000
Module Name: src
Committed By: martin
Date: Wed May 16 09:51:59 UTC 2012
Modified Files:
src/tests/lib/libc/sys: t_pipe2.c
Log Message:
Enable the test for PR kern/46457 now that it does not crash the
kernel any more.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/lib/libc/sys/t_pipe2.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/4645 CVS commit: src/tests/lib/libc/sys
Date: Wed, 16 May 2012 13:48:35 +0000
Module Name: src
Committed By: martin
Date: Wed May 16 13:48:35 UTC 2012
Modified Files:
src/tests/lib/libc/sys: t_pipe2.c
Log Message:
Simplify the test for PR kern/4645 and make it independend of resource
settings.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libc/sys/t_pipe2.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Responsible-Changed-From-To: kern-bug-people->martin
Responsible-Changed-By: martin@NetBSD.org
Responsible-Changed-When: Wed, 16 May 2012 09:56:14 +0000
Responsible-Changed-Why:
I fixed it
State-Changed-From-To: open->pending-pullups
State-Changed-By: martin@NetBSD.org
State-Changed-When: Wed, 16 May 2012 09:56:14 +0000
State-Changed-Why:
Waiting for [pullup-6 #270]
From: "Jeff Rizzo" <riz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/46457 CVS commit: [netbsd-6] src
Date: Sat, 19 May 2012 15:34:33 +0000
Module Name: src
Committed By: riz
Date: Sat May 19 15:34:32 UTC 2012
Modified Files:
src/sys/kern [netbsd-6]: sys_pipe.c
src/tests/lib/libc/sys [netbsd-6]: t_pipe2.c
Log Message:
Pull up following revision(s) (requested by martin in ticket #270):
sys/kern/sys_pipe.c: revision 1.136
tests/lib/libc/sys/t_pipe2.c: revision 1.4
tests/lib/libc/sys/t_pipe2.c: revision 1.5
tests/lib/libc/sys/t_pipe2.c: revision 1.6
tests/lib/libc/sys/t_pipe2.c: revision 1.7
Make sure we can deliver two file descriptors for pipe2() before we set
up anything special (like close on exec).
Fixes PR kern/46457.
Add a case for PR kern/46457. This is skipped for the time being, as it
reproduces the panic described in the PR.
Enable the test for PR kern/46457 now that it does not crash the
kernel any more.
Fix typo in comment.
Simplify the test for PR kern/4645 and make it independend of resource
settings.
To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.135.2.1 src/sys/kern/sys_pipe.c
cvs rdiff -u -r1.3 -r1.3.2.1 src/tests/lib/libc/sys/t_pipe2.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: pending-pullups->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 21 May 2012 01:28:06 +0000
State-Changed-Why:
Pullup completed.
>Unformatted:
(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.