Subject: bin/1539: Possible endless loop in nfsiod
To: None <gnats-bugs@gnats.netbsd.org>
From: Frank van der Linden <frank@struis.fwi.uva.nl>
List: netbsd-bugs
Date: 09/29/1995 00:52:35
>Number:         1539
>Category:       bin
>Synopsis:       Possible endless loop in nfsiod
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 28 20:05:06 1995
>Last-Modified:
>Originator:     Frank van der Linden
>Organization:
BugSpray, Inc.
>Release:        1.0A
>Environment:
NetBSD natte 1.0A NetBSD 1.0A (NATTE) #0: Tue Sep 26 20:09:33 MET 1995
frank@natte:/nfs/natte/nat1/src/sys/arch/i386/compile

>Description:
Under some circumstances (though relatively rare), nfsiod
              can loop endlessly when one of the forked off servers dies
              before the main program has exited, and a SIGCHLD is received.
              This can happen when nfsiod is run on a system with a kernel
              that has been configured without NFSCLIENT. The reapchild()
              function does a loop of wait3() calls as long as the return
              value is != 0. However, wait3() will return -1 if no child
              processes are available, so nfsiod enters a 'busy-wait3()'
              loop.
>How-To-Repeat:
              Run nfsiod on a system without NFS client support, a slow
              system preferably. The bug doesn't always appear, since
              it depends on a race-condition (child exiting before main
              program has exited).
>Fix:
*** nfsiod.c.orig	Tue May 30 14:35:54 1995
--- nfsiod.c	Thu Sep 28 21:42:36 1995
***************
*** 162,168 ****
  	int signo;
  {
  
! 	while (wait3(NULL, WNOHANG, NULL));
  }
  
  void
--- 162,168 ----
  	int signo;
  {
  
! 	while (wait3(NULL, WNOHANG, NULL) > 0);
  }
  
  void
>Audit-Trail:
>Unformatted: