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
 
Lloyd Parkes  
View profile  
 More options Jan 6 1996, 3:00 am
Newsgroups: gnu.bash.bug
From: ll...@pukatea.its.vuw.ac.nz (Lloyd Parkes)
Date: 1996/01/06
Subject: File descriptor 5 is held open
Configuration Information [Automatically generated, do not change]:
Machine: alpha
OS: OSF1
Compiler: cc -migrate
Compilation CFLAGS:  -DHAVE_SETLINEBUF -DHAVE_VFPRINTF -DHAVE_UNISTD_H -DHAVE_STDLIB_H -DHAVE_LIMITS_H  -DHAVE_GETGROUPS -DHAVE_RESOURCE -DHAVE_SYS_PARAM -DVOID_SIGHANDLER -DNLS -D_BSD -DHAVE_WAIT_H  -DHAVE_GETWD -DHAVE_DUP2 -DHAVE_STRERROR  -DHAVE_DIRENT_H -DHAVE_STRING_H  -DHAVE_VARARGS_H -DHAVE_STRCHR    -Dalpha -DOSF1 -DSHELL  -DHAVE_ALLOCA_H   -O4
uname output: OSF1 pukatea.its.vuw.ac.nz V3.2 148 alpha

Bash Version: 1.14
Patch Level: 5

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.

Repeat-By:
Take a minimal program e.g.

        main ()
        {
         sleep (3000);
        }

Compile it and run it under gdb. I use GDB 4.14
(alpha-dec-osf3.0). Before the sleep terminates, interrupt the
program. The gdb prompt will appear. Type the quit command. Gdb will
ask you if you are sure because the program is still running. Type 'y'
and then press enter. Gdb now hangs. You can interrupt gdb and it will
terminate.

You can now use ps to look for the process that was being
debugged. You should find that it is blocked waiting for tty
input. e.g.

          PID TTY      S           TIME COMMAND
        19779 ttyp3    T        0:00.11 /u/its/lloyd/tmp/a.out

I have seen similar behaviour from rsh when used the the X11R5/R6
program xon. I have seen this sort of behaviour on NetBSD/i386,
NetBSD/sparc, SunOS 4, and Irix (these are all from memory though).


 
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.