From anderson@hawaii.conterra.com  Fri Oct 11 10:53:48 1996
Received: from hawaii.conterra.com (hawaii.conterra.com [206.30.180.3])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id KAA14350
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 11 Oct 1996 10:53:47 -0700 (PDT)
Received: (from anderson@localhost) by hawaii.conterra.com (8.7.5/8.6.9) id NAA08025; Fri, 11 Oct 1996 13:47:55 -0400 (EDT)
Message-Id: <199610111747.NAA08025@hawaii.conterra.com>
Date: Fri, 11 Oct 1996 13:47:55 -0400 (EDT)
From: "Stuart R. Anderson" <anderson@hawaii.conterra.com>
Reply-To: anderson@hawaii.conterra.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: telnet hangup bug
X-Send-Pr-Version: 3.2

>Number:         1774
>Category:       bin
>Synopsis:       telnet spins when killed before network is closed
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pst
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 11 11:00:02 PDT 1996
>Closed-Date:    Tue Jan 7 11:48:54 PST 1997
>Last-Modified:  Tue Jan  7 11:49:41 PST 1997
>Originator:     Stuart R. Anderson
>Release:        FreeBSD 2.1-STABLE i386
>Organization:
Stuart Anderson                  anderson@conterra.com
Conterra Communications
>Environment:

	Main server runnning ISP business. Pentium/166.

>Description:

	telnet can go into a run-bound loop if it is killed during the shutdown
	process. telnet keeps going into deadpeer().

>How-To-Repeat:

	We are using pmwho (a portmaster related utility) to create a web
	page displaying who is logged in. Pmwho uses telnet to communicate
	with the Portmaster. When pmwho exits, telnet receives a signal which
	begins the looping.

	During the last incident, we managed to get a load avarage of 100+.

>Fix:

	Reset the signal handler to avoid the loop. There is probably one or
	two other places where this could be placed, but this one works for us.
	
diff -c sys_bsd.c.orig sys_bsd.c
*** sys_bsd.c.orig      Fri Oct 11 13:33:49 1996
--- sys_bsd.c   Fri Oct 11 13:33:59 1996
***************
*** 789,794 ****
--- 789,795 ----
  NetClose(fd)
      int       fd;
  {
+     (void) signal(SIGPIPE, SIG_DFL);
      return close(fd);
  }
  


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->pst 
Responsible-Changed-By: pst 
Responsible-Changed-When: Thu Oct 17 10:32:24 PDT 1996 
Responsible-Changed-Why:  
I'll look at this, I've never seen a similar report before, which seems 
very strange. :-( 
. 
State-Changed-From-To: open->closed 
State-Changed-By: pst 
State-Changed-When: Tue Jan 7 11:48:54 PST 1997 
State-Changed-Why:  
Fixed it using a fix supplied by Paul Vixie courtesy of Dave Borman. 
>Unformatted:
