NetBSD Problem Report #45590

From njoly@lanfeust.sis.pasteur.fr  Tue Nov  8 16:05:08 2011
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 722B363CD23
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  8 Nov 2011 16:05:08 +0000 (UTC)
Message-Id: <20111108160504.6145DDC9BD@lanfeust.sis.pasteur.fr>
Date: Tue,  8 Nov 2011 17:05:04 +0100 (CET)
From: njoly@pasteur.fr
Reply-To: njoly@pasteur.fr
To: gnats-bugs@gnats.NetBSD.org
Subject: MAKEDEV: 4: Bad file descriptor
X-Send-Pr-Version: 3.95

>Number:         45590
>Category:       bin
>Synopsis:       MAKEDEV: 4: Bad file descriptor
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 08 16:10:01 +0000 2011
>Closed-Date:    Thu Nov 10 22:41:02 +0000 2011
>Last-Modified:  Thu Nov 10 22:41:02 +0000 2011
>Originator:     Nicolas Joly
>Release:        NetBSD 5.99.56
>Organization:
Institut Pasteur
>Environment:
System: NetBSD lanfeust.sis.pasteur.fr 5.99.56 NetBSD 5.99.56 (LANFEUST) #2: Tue Nov 8 13:53:41 CET 2011 njoly@lanfeust.sis.pasteur.fr:/local/src/NetBSD/obj.amd64/sys/arch/amd64/compile/LANFEUST amd64
Architecture: x86_64
Machine: amd64
>Description:
MAKEDEV(8) fails when installing -current NetBSD/vax under simh :

     Status: Command failed
    Command: /bin/sh MAKEDEV all
     Hit enter to continue
--------------------------------------------------------------------------------
MAKEDEV: 4: Bad file descriptor

Experiencing with MAKEDEV show that this error occurs for targets that use
makedir() ...

# /bin/sh MAKEDEV all
MAKEDEV: 4: Bad file descriptor
# /bin/sh MAKEDEV zfs
MAKEDEV: 4: Bad file descriptor

I can reproduce it on my amd64 machine with a bogus mtree tool too:

root@lanfeust [/dev]# uname -a
NetBSD lanfeust.sis.pasteur.fr 5.99.56 NetBSD 5.99.56 (LANFEUST) #2: Tue Nov  8 13:53:41 CET 2011  njoly@lanfeust.sis.pasteur.fr:/local/src/NetBSD/obj.amd64/sys/arch/amd64/compile/LANFEUST amd64
root@lanfeust [/dev]# ./MAKEDEV zfs      
root@lanfeust [/dev]# ./MAKEDEV -t xx zfs
./MAKEDEV: Ignored -t option: xx is missing or broken
./MAKEDEV: 4: Bad file descriptor

>How-To-Repeat:
>Fix:

>Release-Note:

>Audit-Trail:
From: "Alan Barrett" <apb@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45590 CVS commit: src/etc
Date: Tue, 8 Nov 2011 19:11:19 +0000

 Module Name:	src
 Committed By:	apb
 Date:		Tue Nov  8 19:11:19 UTC 2011

 Modified Files:
 	src/etc: MAKEDEV.tmpl

 Log Message:
 In the nooutput function, don't mess with file descritor 4
 at the outer level; do it inside a subshell context so as not
 to interfere with a different use of fd 4 by the caller.

 This should fix PR 45590.


 To generate a diff of this commit:
 cvs rdiff -u -r1.145 -r1.146 src/etc/MAKEDEV.tmpl

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

State-Changed-From-To: open->closed
State-Changed-By: njoly@NetBSD.org
State-Changed-When: Thu, 10 Nov 2011 22:41:02 +0000
State-Changed-Why:
Confirmed fixed. Thanks.


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