From owner-freebsd-current Wed Apr 26 14:23: 8 2000 Delivered-To: freebsd-current@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id C936137B986 for ; Wed, 26 Apr 2000 14:23:04 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.3/8.9.1) id OAA97717; Wed, 26 Apr 2000 14:22:47 -0700 (PDT) (envelope-from dillon) Date: Wed, 26 Apr 2000 14:22:47 -0700 (PDT) From: Matthew Dillon Message-Id: <200004262122.OAA97717@apollo.backplane.com> To: "Andrey A. Chernov" Cc: current@FreeBSD.ORG Subject: Re: Workaround for hanging on exit: patch for review References: <20000427011402.A7265@nagual.pp.ru> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :I often notice processes hanging forever on exit's ttywait when TCP :connection dropped. Here is a patch I plan to commit which restrict :waiting for output drain by 3 minutes. Any comments, improvements or :objections? : :--- kern_exit.c.bak Sun Apr 16 23:35:55 2000 :+++ kern_exit.c Thu Apr 27 00:56:02 2000 :@@ -230,6 +230,9 @@ : if (sp->s_ttyp && (sp->s_ttyp->t_session == sp)) { : if (sp->s_ttyp->t_pgrp) : pgsignal(sp->s_ttyp->t_pgrp, SIGHUP, 1); :+ /* XXX don't hang forever */ :+ if (sp->s_ttyp->t_timeout == 0) :+ sp->s_ttyp->t_timeout = 180 * hz; : (void) ttywait(sp->s_ttyp); : /* : * The tty could have been revoked : :-- :Andrey A. Chernov I think this is a good idea. I've seen processes stuck in ttywait forever too, usually when I'm using cu and the remote end is spewing all sorts of junk my way. p.s. (on a different topic) I am also seeing serial stream corruption for serial console output. If I add a kernel printf() that generates a lot of output, I get most of it on the serial console plus a lot of other random garbage. Very weird. -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message