From owner-freebsd-hackers Mon Sep 25 11:25:56 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id LAA18786 for hackers-outgoing; Mon, 25 Sep 1995 11:25:56 -0700 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.34]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id LAA18780 for ; Mon, 25 Sep 1995 11:25:52 -0700 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id EAA27181; Tue, 26 Sep 1995 04:22:29 +1000 Date: Tue, 26 Sep 1995 04:22:29 +1000 From: Bruce Evans Message-Id: <199509251822.EAA27181@godzilla.zeta.org.au> To: freebsd-hackers@FreeBSD.ORG, ponds!rivers@dg-rtp.dg.com Subject: Re: That annoying pty problem again... Sender: owner-hackers@FreeBSD.ORG Precedence: bulk >I just had the "old" vs. "new" (SIGHUP?) pty problem again. >Just to refresh everone's memory, let me know if you've seen this: > 1) Start an Xterm... > 2) Start 'vi' in that xterm. > 3) Shut down the X server, forcing logoff (i.e. CNTL-ALT-BS) > 4) Restart the X server > 5) Start another xterm - which happens to get the same > pty as the one running 'vi' > 6) Suddenly, you'll discover that some of your keystrokes are > going to that (now supposedly dead) 'vi' session, which is > also producing output to your pty (xterm) - along with > the shell you have running in your xterm. > That is - it would appear that a SIGHUP is getting lost; or > the pty driver isn't sending one when the client side is cut > off... This should be fixed in current. Bruce ---------------------------- revision 1.21 date: 1995/09/19 12:26:47; author: bde; state: Exp; lines: +1 -2 Don't clear the session pointer in ptcclose(). It must be left alone until the session leader exits so that a SIGHUP gets sent to the process group and the pty slave gets revoked. ---------------------------- Index: tty_pty.c =================================================================== RCS file: /a/ncvs/src/sys/kern/tty_pty.c,v retrieving revision 1.20 retrieving revision 1.21 diff -c -2 -r1.20 -r1.21 *** 1.20 1995/09/08 11:08:38 --- 1.21 1995/09/19 12:26:47 *************** *** 32,36 **** * * @(#)tty_pty.c 8.2 (Berkeley) 9/23/93 ! * $Id: tty_pty.c,v 1.20 1995/09/08 11:08:38 bde Exp $ */ --- 32,36 ---- * * @(#)tty_pty.c 8.2 (Berkeley) 9/23/93 ! * $Id: tty_pty.c,v 1.21 1995/09/19 12:26:47 bde Exp $ */ *************** *** 323,327 **** tp->t_oproc = 0; /* mark closed */ - tp->t_session = 0; return (0); } --- 323,326 ----