From nobody  Sun Jan 12 08:57:57 1997
Received: (from nobody@localhost)
          by freefall.freebsd.org (8.8.4/8.8.4) id IAA05231;
          Sun, 12 Jan 1997 08:57:57 -0800 (PST)
Message-Id: <199701121657.IAA05231@freefall.freebsd.org>
Date: Sun, 12 Jan 1997 08:57:57 -0800 (PST)
From: andrew@ugh.net.au
To: freebsd-gnats-submit@freebsd.org
Subject: telnet sleeps too much :-)
X-Send-Pr-Version: www-1.0

>Number:         2466
>Category:       bin
>Synopsis:       telnet sleeps too much :-)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 12 09:00:02 PST 1997
>Closed-Date:    Sun Jan 12 22:40:46 MET 1997
>Last-Modified:  Sun Jan 12 15:00:01 PST 1997
>Originator:     Andrew Stevenson
>Release:        2.2-BETA_A
>Organization:
>Environment:
FreeBSD sally.ugh.net.au 2.2-BETA_A FreeBSD 2.2-BETA_A #0: Sat Jan 11 22:19:46
EST 1997	andrew@sally.ugh.net.au:/usr/src/sys/compile/SALLY	i386
>Description:
If you leave telnet idle and then type something it will say "sleep(5)
from telnet, after select". It will continue to work but it messes up
the screen.
>How-To-Repeat:
telnet somewhere and leave it idle for a while, come back to it and type.
>Fix:

>Release-Note:
>Audit-Trail:

From: j@uriah.heep.sax.de (J Wunsch)
To: andrew@ugh.net.au
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: bin/2466: telnet sleeps too much :-)
Date: Sun, 12 Jan 1997 19:10:12 +0100

 As andrew@ugh.net.au wrote:
 
 > If you leave telnet idle and then type something it will say "sleep(5)
 > from telnet, after select". It will continue to work but it messes up
 > the screen.
 
 > >How-To-Repeat:
 > telnet somewhere and leave it idle for a while, come back to it and type.
 
 No, this is not generally repeatable.
 
 I suspect something special with your network setup.  Perhaps you add
 a debug printf to see what the actual error code is.
 
 The code in question (modulo some tn3720 hack) is:
 
     if ((c = select(16, &ibits, &obits, &xbits,
 			(poll == 0)? (struct timeval *)0 : &TimeValue)) < 0) {
 	if (c == -1) {
 		    /*
 		     * we can get EINTR if we are in line mode,
 		     * and the user does an escape (TSTP), or
 		     * some other signal generator.
 		     */
 	    if (errno == EINTR) {
 		return 0;
 	    }
 		    /* I don't like this, does it ever happen? */
 	    printf("sleep(5) from telnet, after select\r\n");
 	    sleep(5);
 	}
 	return 0;
     }
 
 ...so the sleep only happens after select() returned -1 (nothing
 found) but without EINTR.  This is a ``Cannot happen'' situation.
 Perhaps you can investigate a little why it happens in your
 environment.  (Mind you, many people leave telnet sessions idle for
 days.)
 
 -- 
 cheers, J"org
 
 joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
 Never trust an operating system you don't have sources for. ;-)

From: Bill Fenner <fenner@parc.xerox.com>
To: andrew@ugh.net.au
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: bin/2466: telnet sleeps too much :-) 
Date: Sun, 12 Jan 1997 13:01:52 PST

 >If you leave telnet idle and then type something it will say "sleep(5)
 >from telnet, after select".
 
 According to John-Mark Gurney <jmg@nike.efn.org> in freebsd-hackers at
 Christmas time, this is EFAULT again.  Looks like yet another reference
 to kern/2043.
 
   Bill
State-Changed-From-To: open->closed 
State-Changed-By: joerg 
State-Changed-When: Sun Jan 12 22:40:46 MET 1997 
State-Changed-Why:  
Another incarnation of the problem in PR kern/2043, as it seems. 


From: John-Mark Gurney <jmg@nike.efn.org>
To: J Wunsch <j@uriah.heep.sax.de>
Cc: freebsd-bugs@freefall.freebsd.org, freebsd-gnats-submit@freebsd.org
Subject: bin/2466 Re: bin/2466: telnet sleeps too much :-)
Date: Sun, 12 Jan 1997 14:54:53 -0800 (PST)

 On Sun, 12 Jan 1997, J Wunsch wrote:
 
 oh...  this is unrelated... but gnats-submit doesn't pass along the
 reply-to: that you (Joerg) normally have..  just noticed this..
 
 it will probably be missing my 'Reply-to: John-Mark Gurney
 <gurney_j@efn.org>' also...
 
 > The following reply was made to PR bin/2466; it has been noted by GNATS.
 > 
 > From: j@uriah.heep.sax.de (J Wunsch)
 > To: andrew@ugh.net.au
 > Cc: freebsd-gnats-submit@FreeBSD.ORG
 > Subject: Re: bin/2466: telnet sleeps too much :-)
 > Date: Sun, 12 Jan 1997 19:10:12 +0100
 > 
 >  As andrew@ugh.net.au wrote:
 >  
 >  > If you leave telnet idle and then type something it will say "sleep(5)
 >  > from telnet, after select". It will continue to work but it messes up
 >  > the screen.
 >  
 >  > >How-To-Repeat:
 >  > telnet somewhere and leave it idle for a while, come back to it and type.
 >  
 >  No, this is not generally repeatable.
 
 I can do it over here...  just like he says...  I sent a message to
 hackers reciently about this... but didn't get a response...  here is the
 message:
 -----<begin message>------
 well.. I have a diskless machine (386/25sx 6meg ram, swap also nfs) that
 regularly gets this message...  I notice there was a comment about this...
 that he (or whoever added it) doesn't like it...  I just recompiled telnet
 to give me the errno when this happens...
 
 when it does it gives 14 == EFAULT...  it only seems to happen after I've
 let it be for a while...  any body have any suggestions?  should I just
 remove the sleep and be gone with it?  thanks for your suggesstions...
 ttyl..
 -------<end message>------
 
 >  I suspect something special with your network setup.  Perhaps you add
 >  a debug printf to see what the actual error code is.
 
 as the message states... I have... EFAULT...  very wierd is all I can
 say...
 
 >  The code in question (modulo some tn3720 hack) is:
 >  
 >      if ((c = select(16, &ibits, &obits, &xbits,
 >  			(poll == 0)? (struct timeval *)0 : &TimeValue)) < 0) {
 >  	if (c == -1) {
 >  		    /*
 >  		     * we can get EINTR if we are in line mode,
 >  		     * and the user does an escape (TSTP), or
 >  		     * some other signal generator.
 >  		     */
 >  	    if (errno == EINTR) {
 >  		return 0;
 >  	    }
 >  		    /* I don't like this, does it ever happen? */
 >  	    printf("sleep(5) from telnet, after select\r\n");
 >  	    sleep(5);
 >  	}
 >  	return 0;
 >      }
 >  
 >  ...so the sleep only happens after select() returned -1 (nothing
 >  found) but without EINTR.  This is a ``Cannot happen'' situation.
 >  Perhaps you can investigate a little why it happens in your
 >  environment.  (Mind you, many people leave telnet sessions idle for
 >  days.)
 
 yeh... I know...  right now I'm trying to get a tcpdump of a failed select
 to see if that would possibly help...
 
 ok... I got it... the dumped file is 73k...  I just managed to reproduce
 it... it seems to happen when the process (telnet) gets swapped out... the
 machine is a 386/25sx w/ 6megs ram netbooted with swap over nfs...  so if
 I do some stuff on another console the chances of telnet swapping out are
 very high...
 
 I hope this helps...  ttyl...
 
 John-Mark
 
 gurney_j@efn.org
 http://resnet.uoregon.edu/~gurney_j/
 Modem/FAX: (541) 683-6954   (FreeBSD Box)
 
 Live in Peace, destroy Micro$oft, support free software, run FreeBSD (unix)
 
>Unformatted:
