From owner-freebsd-current Sun Oct 27 15:19:26 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id PAA24341 for current-outgoing; Sun, 27 Oct 1996 15:19:26 -0800 (PST) Received: from rocky.mt.sri.com (rocky.mt.sri.com [206.127.76.100]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id PAA24335 for ; Sun, 27 Oct 1996 15:19:22 -0800 (PST) Received: (from nate@localhost) by rocky.mt.sri.com (8.7.5/8.7.3) id QAA18645; Sun, 27 Oct 1996 16:19:12 -0700 (MST) Date: Sun, 27 Oct 1996 16:19:12 -0700 (MST) Message-Id: <199610272319.QAA18645@rocky.mt.sri.com> From: Nate Williams To: Archie Cobbs Cc: current@freebsd.org Subject: Re: Strange bug related to fstat() In-Reply-To: <199610272250.OAA14535@bubba.whistle.com> References: <199610272250.OAA14535@bubba.whistle.com> Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > Within a little background daemon, the system() command is used > to execute a command looking something like this: > > system("tar cf - file1 file2 | gzip -cf | uuencode files > output"); > > What's happening is that gzip is failing, and the place it fails > is where it tries to fstat() standard input: > > if (fstat(fileno(stdin), &istat) != 0) { > error("fstat(stdin)"); > } > > The error it's getting is "Bad file descriptor". ... > The only other possibilities seem to be a bug in /bin/sh or the > kernel. As you can see, I need a little hint as to how to pursue > this one... Older versions of ash (pre-4.4Lite) used to get this error all the time, so I suspect a sh bug. I don't know for sure, but it's strikingly familiar. Nate