From owner-freebsd-bugs Sun May 4 08:50:06 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id IAA00470 for bugs-outgoing; Sun, 4 May 1997 08:50:06 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.5/8.8.5) id IAA00452; Sun, 4 May 1997 08:50:04 -0700 (PDT) Resent-Date: Sun, 4 May 1997 08:50:04 -0700 (PDT) Resent-Message-Id: <199705041550.IAA00452@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, sbauer@rock.sdsmt.edu Received: from krypton.hpc.sdsmt.edu (uurock@krypton.hpc.sdsmt.edu [151.159.81.5]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id IAA00199 for ; Sun, 4 May 1997 08:44:19 -0700 (PDT) Received: (from uurock@localhost) by krypton.hpc.sdsmt.edu (8.8.5/8.8.5) id JAA14600 for FreeBSD-gnats-submit@freebsd.org; Sun, 4 May 1997 09:44:16 -0600 Received: (from root@localhost) by rock.sdsmt.edu (8.8.5/8.8.5) id JAA03968; Sun, 4 May 1997 09:47:08 -0600 (MDT) Message-Id: <199705041547.JAA03968@rock.sdsmt.edu> Date: Sun, 4 May 1997 09:47:08 -0600 (MDT) From: Steve Bauer Reply-To: sbauer@rock.sdsmt.edu To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: kern/3495: error in _thread_fd_table setup in libc_r -- thread_init.c Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 3495 >Category: kern >Synopsis: _thread_fd_table is not initialized with inherited fd's >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun May 4 08:50:02 PDT 1997 >Last-Modified: >Originator: Steve Bauer >Organization: South Dakota School of Mines and Technology >Release: FreeBSD 2.2-STABLE i386 >Environment: The environment is the standard FreeBSD-2.2-Stable with ctm patch 0263 applied to the system. >Description: File desciptors that are inherited from the parent process (ie shell) are not added to the _thread_fd_table. Thus when they are accessed say using read the error Bad File Descriptor is returned. This effects programs that like to read from stdio using read. >How-To-Repeat: Read data from stdin using read. >Fix: Below is a patch that seems to fix the problem: *** uthread_init.c.orig Mon Apr 28 22:29:03 1997 --- uthread_init.c Sun May 4 09:36:46 1997 *************** *** 183,188 **** --- 183,189 ---- for (i = 0; i < _thread_dtablesize; i++) { /* Initialise the file descriptor table: */ _thread_fd_table[i] = NULL; + _thread_fd_table_init(i); } } } >Audit-Trail: >Unformatted: