From owner-freebsd-hackers Wed Nov 8 12:17:24 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp02.primenet.com (smtp02.primenet.com [206.165.6.132]) by hub.freebsd.org (Postfix) with ESMTP id 4730537B479 for ; Wed, 8 Nov 2000 12:17:22 -0800 (PST) Received: (from daemon@localhost) by smtp02.primenet.com (8.9.3/8.9.3) id NAA03316; Wed, 8 Nov 2000 13:13:26 -0700 (MST) Received: from usr08.primenet.com(206.165.6.208) via SMTP by smtp02.primenet.com, id smtpdAAA3vaqCg; Wed Nov 8 13:13:20 2000 Received: (from tlambert@localhost) by usr08.primenet.com (8.8.5/8.8.5) id NAA25041; Wed, 8 Nov 2000 13:17:10 -0700 (MST) From: Terry Lambert Message-Id: <200011082017.NAA25041@usr08.primenet.com> Subject: Re: daemon() To: fjoe@iclub.nsu.ru (Max Khon) Date: Wed, 8 Nov 2000 20:17:09 +0000 (GMT) Cc: Don.Lewis@tsc.tdk.com (Don Lewis), andrew@ugh.net.au, hackers@FreeBSD.ORG In-Reply-To: from "Max Khon" at Nov 07, 2000 08:29:37 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > } > what is FD 4? > > } > > } I can't reproduce this? Does it always happen? > > > > It might be something that the shell forgets to close, so it will be > > dependent on which shell you use. > > exactly. this does not happen if I run this program from tcsh > (but does if I run from bash 1.14.7(1) built from ports > thanks! It appears to be a bash bug, with not setting close on exec on the fd it uses for its tty, in order to hide from shell scripts. The problem is that if you redirect input, bash has no tty on which to do reads, etc.. Feel lucky: it used to be worse. It uses to go out and try to get the highest posible fd for doing this crap, which meant waiting for it to eat up all of kernel memory chasing fd's until there was no more memory available for the per process open file table. All in all, bash is pretty buggy. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message