NetBSD Problem Report #461

From gnats  Mon Sep  5 13:33:43 1994
Received: from yarrina.connect.com.au (yarrina.connect.com.au [192.189.54.17]) by sun-lamp.cs.berkeley.edu (8.6.9/8.6.9) with SMTP id NAA01863 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Mon, 5 Sep 1994 13:33:40 -0700
Message-Id: <199409051306.XAA02503@nemeton.com.au>
Date: Mon, 5 Sep 1994 23:06:36 +1000
From: Giles Lean <giles@nemeton.com.au>
Reply-To: giles@nemeton.com.au
To: gnats-bugs@sun-lamp.cs.berkeley.edu
Subject: Possible tty driver bug (breaks UUCP)
X-Send-Pr-Version: 3.2

>Number:         461
>Category:       kern
>Synopsis:       read(2) on tty with modem control returns 0 with EINTR set
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    gnats-admin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 05 13:35:03 +0000 1994
>Closed-Date:    Fri Feb 09 02:36:33 +0000 1996
>Last-Modified:  Thu Jul 14 03:04:24 +0000 2005
>Originator:     Giles Lean
>Release:        NetBSD-current (August 22nd source)
>Organization:
Nemeton Pty Ltd
----
Giles Lean
Nemeton Pty Ltd, 6/111 Flinders Street, Thornbury 3071 AUSTRALIA
<giles@nemeton.com.au> 			 phone:   +61 3 480 2118
>Environment:

System: NetBSD nemeton.com.au 1.0_BETA NetBSD 1.0_BETA (MAENOR) #0: Sat Sep 3 14:57:04 EST 1994 giles@nemeton.com.au:/usr/src/sys/arch/i386/compile/MAENOR i386

The hardware is a 486SX/33 with:
com0 at isa0 port 0x3f8-0x3ff irq 4: ns82450 or ns16450, no fifo
com1 at isa0 port 0x2f8-0x2ff irq 3: ns82450 or ns16450, no fifo


>Description:
	With sources from about the 6th of August, I found that uucico
	reported lost carrier while I could see the carrier detect light
	on the modem remained high.  This problem continues in Aug. 22nd
	source.

	Checking the uucico source indicated that it would report the
	line had disconnected when it received a return value of zero
	from read(), i.e. end of file.
	[See /usr/src/gnu/libexec/uucp/libunix/serial.c line #2015.]

	The basic problem is that read(2) should return the number of
	characters read for a partial read EXCEPT when the number of
	characters is zero, when -1 must be returned instead else it looks
	like end of file.

	(POSIX handwaves and lets you return -1 instead of the number of
	characters actually read, but I hope nobody would implement that.
	Considering zero characters to be a partial read would presumably
	satisfy the standard, but is too perverse to consider.)

>How-To-Repeat:
	The problem shows with only one or two uucp links I have.  On
	that link, however, it repeats every time. (The remote end is
	a CISCO terminal server connecting to either a Sun or a Solbourne
	running Taylor UUCP.)
>Fix:
	Requires a kernel hacker.  I had fun looking. :-)

	The workaround for uucico for anyone desparate to get uucp up
	and running again:

*** 1.1	1994/09/03 05:11:09
--- /usr/src/gnu/libexec/uucp/libunix/serial.c	1994/09/05 12:45:16
***************
*** 1997,2003 ****
  	 reduce problems with interrupted system calls.  */
        if (cgot <= 0)
  	{
! 	  if (cgot < 0 && errno == EINTR)
  	    cgot = 0;
  	  else
  	    {
--- 1997,2003 ----
  	 reduce problems with interrupted system calls.  */
        if (cgot <= 0)
  	{
! 	  if (cgot <= 0 && errno == EINTR)
  	    cgot = 0;
  	  else
  	    {
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: mycroft 
State-Changed-When: Thu Feb 8 00:15:24 EST 1996 
State-Changed-Why:  
This is not a bug in the tty driver, although it may be a bug in UUCP. 
Both POSIX and historic practice allow for a return value of 0 from 
read(2) in the case where VMIN == 0 and VTIME == 0.  If this is 
happening in UUCP, then freceive_data() is being called with a cneed 
count of 0, or a full buffer, either of which is an error in UUCP 
itself.  Knowing which protocol is in use at the time would make it 
easier (read: perhaps possible) to track this down. 
State-Changed-From-To: analyzed->closed 
State-Changed-By: mycroft 
State-Changed-When: Thu Feb 8 21:36:33 EST 1996 
State-Changed-Why:  
Fixed in later versions of Taylor UUCP. 

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.