[6484] in Athena Bugs

home help back first fref pref prev next nref lref last post

vax 7.1H: /bin/tcsh

daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Wed Nov 28 16:37:44 1990

Date: Wed, 28 Nov 90 16:37:20 -0500
From: John T Kohl <jtkohl@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU

System name:		lycus
Type and version:	CVAXSTAR 7.1H
Display type:		SM

What were you trying to do?
	Find out where some extra open file descriptors came from.

What's wrong:
	In some cases, the shell doesn't properly close fds #17,18,19.
This program (foo):
main()
{
    printf("pid=%d\n",getpid());
    while(1)
	sigpause(0);
}

combined with 'ofiles' (from watchmaker bin) shows the leak.

- ---------- window #1: ---------
[{1}lycus:/tmp]
% cc -c foo.c
cc -o foo foo.o
[{1}lycus:/tmp]
% cc -o foo foo.o
[{1}lycus:/tmp]
% ./foo
pid=17917
^C[{1}lycus:/tmp]
% (./foo&)
[{1}lycus:/tmp]
% pid=17921

[{1}lycus:/tmp]
% kill 17921
[{1}lycus:/tmp]
% where ofiles
/mit/watchmaker/vaxbin/ofiles
[{1}lycus:/tmp]
%
- ------------- window #2: -------------
% ofiles 17917
user     process command
jtkohl   17917   foo
 text = file inode 917 on local fs 151e (/site)
 cwd = directory inode 896 on local fs 151e (/site)
 fd #0  = character special device /dev/ttyp2
 fd #1  = character special device /dev/ttyp2
 fd #2  = character special device /dev/ttyp2
Exit 1               ofiles 17917
[{1}lycus:~]
% ofiles 17921
user     process command
jtkohl   17921   foo
 text = file inode 917 on local fs 151e (/site)
 cwd = directory inode 896 on local fs 151e (/site)
 fd #0  = character special device /dev/ttyp2
 fd #1  = character special device /dev/ttyp2
 fd #2  = character special device /dev/ttyp2
 fd #17 = character special device /dev/ttyp2
 fd #18 = character special device /dev/ttyp2
 fd #19 = character special device /dev/ttyp2
Exit 1               ofiles 17921
[{1}lycus:~]
%

What should have happened:
	The shell should clean up on things like (foo&)

Please describe any relevant documentation references:
	csh(1), close(2)


home help back first fref pref prev next nref lref last post