From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay1.UU.NET ([137.39.1.5]) by archone.tamu.edu with SMTP id <18983>; Sat, 9 Nov 1991 22:44:34 -0600 Received: from uunet.uu.net (via LOCALHOST.UU.NET) by relay1.UU.NET with SMTP (5.61/UUNET-internet-primary) id AA08113; Sat, 9 Nov 91 23:40:05 -0500 Received: from scocan.UUCP by uunet.uu.net with UUCP/RMAIL (queueing-rmail) id 233949.6058; Sat, 9 Nov 1991 23:39:49 EST Received: from golem by scocan.scocan.sco.COM id aa15115; 9 Nov 91 23:13 EST Received: by golem.uucp (/\==/\ Smail3.1.22.1 #22.12) id ; Sat, 9 Nov 1991 22:38 -0500 Message-Id: To: rc@archone.tamu.edu Subject: File descriptor leak. Date: Sat, 9 Nov 1991 21:38:08 -0600 From: "David J. Fiander" rc slowly opens, and then forgets about file descriptors when one uses the "<{cmd}" construct on a system with /dev/fd. The problem is that glom() calls mkcmdarg(), which creates a pipe, forks, sets up the child to read from (or write to) the pipe, sets the name of the argument for the parent, and then forgets about the file. After the pipeline has terminated (or rc has forked to execute the pipeline), then rc should close the pipe end it has open, but it never does. The best way to see this behaviour, is to repeatedly run the command echo <{echo hello world} This will create the pipe between the inner echo and the out echo, but the outer echo will simply echo the name of the file which was passed to it. If the problem did not exist, then the same file name would be echoed every time, but it isn't. Eventually, you will run out of fds. Anybody got any ideas? -- David J. Fiander |A man ought to read just as inclination leads him; for |what he reads as a task will do him little good.