From owner-freebsd-current Sun Oct 27 14:51:00 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id OAA22119 for current-outgoing; Sun, 27 Oct 1996 14:51:00 -0800 (PST) Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id OAA22112 for ; Sun, 27 Oct 1996 14:50:56 -0800 (PST) Received: (from smap@localhost) by whistle.com (8.7.5/8.6.12) id OAA15839; Sun, 27 Oct 1996 14:50:25 -0800 (PST) Received: from bubba.whistle.com(207.76.205.7) by whistle.com via smap (V1.3) id sma015837; Sun Oct 27 14:50:22 1996 Received: (from archie@localhost) by bubba.whistle.com (8.7.5/8.6.12) id OAA14535; Sun, 27 Oct 1996 14:50:22 -0800 (PST) From: Archie Cobbs Message-Id: <199610272250.OAA14535@bubba.whistle.com> Subject: Strange bug related to fstat() To: current@freebsd.org Date: Sun, 27 Oct 1996 14:50:22 -0800 (PST) X-Mailer: ELM [version 2.4ME+ PL25 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I'm trying to track down a bug that's completely baffling to me... any help would be greatly appreciated. This is in a pretty -current environment. 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". Of course, if there's any way the daemon could be causing this to happen I'm sure it is! But I can't figure out how it could. Can this error possibly be correct, unless there is a bug in gzip itself? Even if the "tar" command failed, standard input should still exist until closed, no? 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... Thanks for any help. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com