From owner-freebsd-hackers Fri Feb 16 03:29:10 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id DAA29380 for hackers-outgoing; Fri, 16 Feb 1996 03:29:10 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id DAA29375 for ; Fri, 16 Feb 1996 03:28:59 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id WAA07943; Fri, 16 Feb 1996 22:18:55 +1100 Date: Fri, 16 Feb 1996 22:18:55 +1100 From: Bruce Evans Message-Id: <199602161118.WAA07943@godzilla.zeta.org.au> To: babkin@hq.icb.chel.su, bde@zeta.org.au Subject: Re: Digi patch Cc: hackers@freebsd.org Sender: owner-hackers@freebsd.org Precedence: bulk >There is a fix for the bug reported to me by Alexis Yashin (sometimes >the process hangs when closing digi port). Commit it please. >Thank you! >*** dgb.c 1996/02/05 04:35:28 >--- dgb.c 1996/02/05 04:40:17 >*************** >*** 1386,1391 **** >--- 1386,1392 ---- > } > #ifndef TS_ASLEEP /* post 2.0.5 FreeBSD */ > ttwwakeup(tp); >+ wakeup(TSA_OCOMPLETE(tp)); > #else > if(tp->t_state & TS_ASLEEP) { > tp->t_state &= ~TS_ASLEEP; Er, it's wrong. Processes sleeping on TSA_OCOMPLETE(tp) should not be woken up until output is complete. ttwwakeup() does this. Output is complete if t_outq is empty and the TS_BUSY bit is clear. The bug is probably that TS_BUSY doesn't get cleared properly. TS_BUSY apparently gets cleared in the next call to t_oproc() - otherwise ttywait() would loop forever waking itself up. The extra wakeup would be harmless if this livelock wasn't a possibility. Bruce