Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Feb 1999 13:39:24 -0800 (PST)
From:      hansen@cmu.edu
To:        freebsd-gnats-submit@FreeBSD.ORG
Subject:   bin/9986: rsh hangs when called by system() from process with eleven open files.
Message-ID:  <199902092139.NAA11115@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902092139.NAA11115>