From owner-freebsd-current Fri May 14 10:36:45 1999 Delivered-To: freebsd-current@freebsd.org Received: from lor.watermarkgroup.com (lor.watermarkgroup.com [207.202.73.33]) by hub.freebsd.org (Postfix) with ESMTP id 1B645151A2 for ; Fri, 14 May 1999 10:36:42 -0700 (PDT) (envelope-from luoqi@watermarkgroup.com) Received: (from luoqi@localhost) by lor.watermarkgroup.com (8.8.8/8.8.8) id NAA06376; Fri, 14 May 1999 13:36:41 -0400 (EDT) (envelope-from luoqi) Date: Fri, 14 May 1999 13:36:41 -0400 (EDT) From: Luoqi Chen Message-Id: <199905141736.NAA06376@lor.watermarkgroup.com> To: fullermd@futuresouth.com, sheldonh@uunet.co.za Subject: Re: Panic with screen w/info (was Re: Today's kernel crashes on starting X) Cc: current@FreeBSD.ORG, gmarco@scotty.masternet.it Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > It seems that screen was trying to flush the master pty, before the slave > tty was even open. We were lucky that this didn't crash our machines before > the dev_t changes, it only caused the console to be flushed instead. But > after the dev_t changes, it is fatal. Try this fix (band-aid only, better > fix should involve checking of TS_OPEN bit), > Here's the better fix, please let me know if it works, Index: tty_pty.c =================================================================== RCS file: /home/ncvs/src/sys/kern/tty_pty.c,v retrieving revision 1.57 diff -u -r1.57 tty_pty.c --- tty_pty.c 1999/05/08 06:39:43 1.57 +++ tty_pty.c 1999/05/14 17:32:33 @@ -674,8 +674,7 @@ tp->t_lflag &= ~EXTPROC; } return(0); - } else - if (devsw(dev)->d_open == ptcopen) + } else if (devsw(dev)->d_open == ptcopen) { switch (cmd) { case TIOCGPGRP: @@ -711,7 +710,16 @@ pti->pt_flags &= ~PF_REMOTE; ttyflush(tp, FREAD|FWRITE); return (0); + } + + /* + * The rest of the ioctls shouldn't be called until + * the slave is open. (Should we return an error?) + */ + if ((tp->t_state & TS_ISOPEN) == 0) + return (0); + switch (cmd) { #ifdef COMPAT_43 case TIOCSETP: case TIOCSETN: @@ -735,6 +743,7 @@ ttyinfo(tp); return(0); } + } error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p); if (error == ENOIOCTL) error = ttioctl(tp, cmd, data, flag); -lq To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message