Subject: port-i386/546: stty hang on com port
To: None <gnats-admin@sun-lamp.cs.berkeley.edu>
From: Michael L. VanLoon <michaelv@HeadCandy.com>
List: netbsd-bugs
Date: 11/02/1994 22:05:06
>Number:         546
>Category:       port-i386
>Synopsis:       stty on serial port can hang machine
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Nov  2 22:05:04 1994
>Originator:     Michael L. VanLoon
>Organization:
HeadCandy Associates... Sweets for the lobes.
>Release:        1.0
>Environment:
NICE Super-EISA motherboard, AMD 486DX2/80, 20MB RAM, BusLogic bt747s,
NetBSD-1.0
System: NetBSD MindBender.HeadCandy.com 1.0 NetBSD 1.0 (MINDBENDER) #202: Thu Oct 20 02:42:14 CDT 1994 michaelv@MindBender.HeadCandy.com:/usr/src/sys/arch/i386/compile/MINDBENDER i386


>Description:
This command will hang my machine:

	sleep 15 < /dev/tty00 & ; stty -f /dev/tty00 115200 clocal \
	crtscts -mdmbuf -parity -ixon -ixany

It doesn't always hang the first time, if it's a fresh boot, but it
will happen the 2nd or third time.  If the serial line has been used
some, it will commonly hang the first time this command is issued.
When it hangs, it's as if it's in a tight loop with interrupts
disabled, because it doesn't go automatically into DDB, and I can't
get it to break into DDB from the keyboard.

This started with sources around the beginning of October (for me).  A
kernel built Sep. 14th (and everything earlier) does not suffer from
this bug (i.e. I can type this command over and over infinitely with
no danger of a hang).

My modem is set up like this in /etc/ttys:

	tty00   "/usr/libexec/getty std.115200" vt100 off rtscts

The modem is hung up, and carrier-detect is not asserted when this
happens, and the sleep opens the serial port.  Generally (from
observations), if something else opens the serial port (like pppd)
prior to issuing an stty command on it, the hang doesn't happen.

>How-To-Repeat:
Issue the command above (or an appropriate approximation) until the
machine hangs.  Make sure the carrier-deted is not asserted, and that
the sleep opens the com port (no prior processes holding it open).

>Fix:
I don't know, but I do seem to remember seeing some changes to the com
stuff from cgd right around the end of Sept., or beginning of Oct.,
about the same time this showed up.

>Audit-Trail:
>Unformatted: