Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Message from discussion File descriptor 5 is held open
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Chet Ramey  
View profile  
 More options Jan 9 1996, 3:00 am
Newsgroups: gnu.bash.bug
From: c...@odin.ins.cwru.edu (Chet Ramey)
Date: 1996/01/09
Subject: Re: File descriptor 5 is held open

> Description:
>         When bash execs another program, the new program inherits an
> open file descriptor. File descriptor #5 to be precise. This file
> descriptor is open for reading and under various circumstances the new
> program will block waiting for input on that descriptor. I have seen
> this before on other platforms, but now is is becoming a pain in the
> neck, rather than just a bash foible.

This sounds like the old BSD rshd bug.  A description from several years
ago is appended.

You can use a program that prints out information about open file descriptors
using fstat, run that from bash so it inherits the open fd, and try to
track down what kind of fd is is from that (socket, file, etc.).  It's
possible that it's a file descriptor left open by the YP library functions.

Message describing the bug:

This is a bug alright, but it's a bug with rshd that's not fixed until
4.3-reno.

rshd sets up a pipe (int pv[2]; if you have the source to the tahoe rshd)
to the process it executes and uses it to manage error and control output
from over the net.  In the child process, it does a dup2(pv[1], 2), but
never calls close(pv[1]).  Adding that code to the 4.3-tahoe rshd makes it
(and the Xemacs script) work right.

I don't know how to solve this cleanly in bash.  Doing a blanket close of
all open file descriptors < 2, < 20 is a no-no, especially when we're not
interactive.  csh `works' because it does the blanket close on startup, but
csh can get away with doing that because it doesn't let you manipulate
arbitrary file descriptors.

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, Case Western Reserve University     Internet: c...@po.CWRU.Edu


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.