Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Jan 1997 01:38:04 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-current@freebsd.org, regnauld@deepo.prosa.dk
Subject:   Re: 2.2-B hang on serial DTR/CTS ? transition
Message-ID:  <199701301438.BAA12863@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>I've been noticing this for some time in -current (and in 2.2-B):
>whenever the modem is unavailable in some way for some time (power
>cycle, unplugged, ...), the machine would totally freeze up for some
>seconds, and sometimes never recovered at all.  I've also seen this
>during bad connections when the modem retrained.  
>
>This behavior appeared I think sometime late last year, and I haven't 
>changed my rc.serial (still uses dtrwait 100 drainwait 180).

BSD tries too hard to drain output in close(), and late last year I
fixed a bug that stopped it from trying as hard as it intended :-).
However, I don't know how sleeping in close() would totally freeze the
machine or use 65% of the CPU, and the change should not make a noticeable
difference if the hardware is working, since it only affects draining the
last few characters and working hardware should ignore CTS so the last
few characters should be transmitted within a few msec.  Long sleeps in
close() when there are more than a few characters to drain have been a
problem for a long time.  There are problems if the device is reopened
before close() finishes.  Use a smaller drainwait to limit the sleeps.
The value should depend on the speed so that normal output isn't aborted.
One second is probably OK at modem speeds.

>I could until yesterday say, "I can live with it", but I recompiled
>a new kernel for my work machine here (2.2-B, 486-133 AMD, IDlE disks),
>and it kept freezing _right_ after 'starting local daemons: .' and
>the display of the date. (the change between the two kernels was
>the addition of a 3Com ep device).
>
>I finally traced it to getty hanging on ttyd1 because I had turned
>the modem _off_!  Logging in right away and running top showed
>getty using 65% CPU and going down.
>
>What bothers me is that that with only one ep0, it doesn't hang...

Use `ps l' and `pstat -t' to get more information.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701301438.BAA12863>