Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Dec 1998 02:10:01 -0800 (PST)
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-bugs@FreeBSD.ORG
Subject:   Re: bin/9188: telnet gets stuck in ttydrain()
Message-ID:  <199812251010.CAA01171@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/9188; it has been noted by GNATS.

From: Bruce Evans <bde@zeta.org.au>
To: FreeBSD-gnats-submit@FreeBSD.ORG, toasty@dragondata.com
Cc:  Subject: Re: bin/9188: telnet gets stuck in ttydrain()
Date: Fri, 25 Dec 1998 21:04:54 +1100

 > 11573 telnet   CALL  write(0x1,0x8058c20,0x174)
 > 11573 telnet   RET   write -1 errno 5 Input/output error
 > 11573 telnet   CALL  ioctl(0,TIOCSETAW,0xefbfd8c8)
 > 11573 telnet   RET   ioctl -1 errno 9 Bad file descriptor
 > 11573 telnet   CALL  write(0x1,0x8058c20,0x174)
 > 11573 telnet   RET   write -1 errno 5 Input/output error
 > 11573 telnet   CALL  ioctl(0,TIOCSETAW,0xefbfd8c8)
 > 11573 telnet   RET   ioctl -1 errno 9 Bad file descriptor
 > 11573 telnet   CALL  write(0x1,0x8058c20,0x174)
 > 11573 telnet   RET   write -1 errno 5 Input/output error
 > 11573 telnet   CALL  ioctl(0,TIOCSETAW,0xefbfd8c8)
 > 11573 telnet   RET   ioctl -1 errno 9 Bad file descriptor
 >
 >Which appears to be in sys_bsd.c:ttydrain
 >
 >Perhaps that while loop should check for fatal errors rather than retrying
 >everything? Or is this a case that it should never have gotten this far with
 >the FD being closed?
 
 The tty appears to be revoked, not closed.  write() would set errno
 to EBADF if the FD were closed.  ioctl() shouldn't return EBADF for
 open revoked FDs, but it was broken until a month or two after 3.0R.
 Now it returns ENOTTY.  This won't help telnet.
 
 The loop seems to be actually in sys_bsd.c:TerminalNewMode.  ttydrain
 doesn't exist.
 
 Telnet shouldn't retry after an error unless it knows that this is OK
 (perhaps it is OK for EAGAIN).
 
 Bruce

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?199812251010.CAA01171>