From owner-freebsd-bugs Tue Feb 9 13:40:07 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA11287 for freebsd-bugs-outgoing; Tue, 9 Feb 1999 13:40:07 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA11209 for ; Tue, 9 Feb 1999 13:40:03 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.2/8.9.2) id NAA70827; Tue, 9 Feb 1999 13:40:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from nobody@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA11115; Tue, 9 Feb 1999 13:39:24 -0800 (PST) (envelope-from nobody) Message-Id: <199902092139.NAA11115@hub.freebsd.org> Date: Tue, 9 Feb 1999 13:39:24 -0800 (PST) From: hansen@cmu.edu To: freebsd-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: www-1.0 Subject: bin/9986: rsh hangs when called by system() from process with eleven open files. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 9986 >Category: bin >Synopsis: rsh hangs when called by system() from process with eleven open files. >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Feb 9 13:40:00 PST 1999 >Closed-Date: >Last-Modified: >Originator: Jeffery Hansen >Release: 3.0 >Organization: Carnegie Mellon University >Environment: FreeBSD gadoid.ices.cmu.edu 3.0-RELEASE FreeBSD 3.0-RELEASE #0: Mon Dec 7 09:56:02 EST 1998 hansen@gadoid.ices.cmu.edu:/usr/src/sys/compile/SAWAKO i386 >Description: When rsh is invoked using system(), the call to system() will hang indefinately if too many (eleven or more in addition to stdin, etc.) files are open. More specifically the problem occurs when fewer than three of the file descriptors in the range 0-15 are unused. >How-To-Repeat: for (i = 0;i < 11;i++) /* OK if 10 or lower */ fopen("/dev/null","r"); system("rsh foo.bar.org any-command"); >Fix: The problem appears to be the hard-coded value of 16 for nfds in the calls to select() in rsh.c. This needs to be fixed to reflect the actual values of the file descriptors selected on. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message