From chris@Thanatos.Shenton.Org Sun Mar  7 10:17:54 1999
Return-Path: <chris@Thanatos.Shenton.Org>
Received: from Thanatos.Shenton.Org (Thanatos.Shenton.Org [209.31.147.195])
	by hub.freebsd.org (Postfix) with ESMTP id 0D0B114CCE
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  7 Mar 1999 10:17:10 -0800 (PST)
	(envelope-from chris@Thanatos.Shenton.Org)
Received: (from root@localhost)
	by Thanatos.Shenton.Org (8.9.2/8.9.1) id NAA52530;
	Sun, 7 Mar 1999 13:22:27 -0500 (EST)
	(envelope-from chris)
Message-Id: <199903071822.NAA52530@Thanatos.Shenton.Org>
Date: Sun, 7 Mar 1999 13:22:27 -0500 (EST)
From: chris@shenton.org
Sender: chris@Thanatos.Shenton.Org
Reply-To: chris@Thanatos.Shenton.Org
To: FreeBSD-gnats-submit@freebsd.org
Subject: 3.1-STABLE tftpd zombie and inetd hange TFTP after one use
X-Send-Pr-Version: 3.2

>Number:         10468
>Category:       i386
>Synopsis:       tftpd becomes zombie after one use hanging on inetd
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    des
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar  7 10:20:01 PST 1999
>Closed-Date:    Wed May 12 05:15:37 PDT 1999
>Last-Modified:  Wed May 12 05:15:51 PDT 1999
>Originator:     Chris Shenton
>Release:        FreeBSD 3.1-STABLE i386
>Organization:
>Environment:

tftpd run from inetd on a recently cvsupped 3.1-STABLE machine

>Description:

When using tftpd, the first connection will succeed, but then tftpd becomes  a
zombie and won't accept/process subsequent get/puts. Killing and restarting
inetd fixes this and will allow tcpd to work again, for one use.

>How-To-Repeat:

tftp localhost
put ExistingFileName
[succeeds]
put ExistingFileName
[fails]

>Fix:
	
Workaround: kill and restart inetd after each tftpd use -- painful.
kill -HUP inetd doesn't help
	

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->des 
Responsible-Changed-By: des 
Responsible-Changed-When: Tue May 11 05:21:24 PDT 1999 
Responsible-Changed-Why:  
There's a high probability that this is the same bug as bin/11594, which 
I'm handling. 

From: Dag-Erling Smorgrav <des@flood.ping.uio.no>
To: chris@Thanatos.Shenton.Org
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: i386/10468: 3.1-STABLE tftpd zombie and inetd hange TFTP after one use
Date: 11 May 1999 14:43:28 +0200

 chris@shenton.org writes:
 > When using tftpd, the first connection will succeed, but then tftpd becomes  a
 > zombie and won't accept/process subsequent get/puts. Killing and restarting
 > inetd fixes this and will allow tcpd to work again, for one use.
 
 Please try the attached patch.
 
 DES
 -- 
 Dag-Erling Smorgrav - des@flood.ping.uio.no
 
 Index: inetd.c
 ===================================================================
 RCS file: /home/ncvs/src/usr.sbin/inetd/inetd.c,v
 retrieving revision 1.48
 diff -u -r1.48 inetd.c
 --- inetd.c	1999/04/11 09:22:17	1.48
 +++ inetd.c	1999/05/11 12:33:29
 @@ -465,17 +465,17 @@
  		exit(EX_OSERR);
  	}
  	FD_SET(signalpipe[0], &allsock);
 -	if (signalpipe[0]>maxsock) maxsock = signalpipe[0];
 +	nsock++;
 +	if (signalpipe[0] > maxsock)
 +	    maxsock = signalpipe[0];
  
  	for (;;) {
  	    int n, ctrl;
  	    fd_set readable;
  
  	    if (nsock == 0) {
 -		(void) sigblock(SIGBLOCK);
 -		while (nsock == 0)
 -		    sigpause(0L);
 -		(void) sigsetmask(0L);
 +		syslog(LOG_ERR, "%s: nsock=0", __FUNCTION__);
 +		exit(EX_SOFTWARE);
  	    }
  	    readable = allsock;
  	    if ((n = select(maxsock + 1, &readable, (fd_set *)0,
 
State-Changed-From-To: open->closed 
State-Changed-By: des 
State-Changed-When: Wed May 12 05:15:37 PDT 1999 
State-Changed-Why:  
Fixed in 4.0 and 3.2. 
>Unformatted:
