From tim@x22  Fri Jul  4 06:16:14 1997
Received: from x22 (ppp6573.on.sympatico.ca [206.172.208.165])
          by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id GAA24387
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 4 Jul 1997 06:16:12 -0700 (PDT)
Received: (from tim@localhost) by x22 (8.8.5/8.7.3) id JAA00298; Fri, 4 Jul 1997 09:15:00 -0400 (EDT)
Message-Id: <199707041315.JAA00298@x22>
Date: Fri, 4 Jul 1997 09:15:00 -0400 (EDT)
From: timmmyymymy <ac199@hwcn.org>
Reply-To: ac199@hwcn.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: syscons thinks CTRL is always pressed
X-Send-Pr-Version: 3.2

>Number:         4030
>Category:       i386
>Synopsis:       syscons thinks CTRL pressed, must reboot [repeatable]
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul  4 06:20:01 PDT 1997
>Closed-Date:    Tue Jul 15 08:04:52 PDT 1997
>Last-Modified:  Tue Jul 15 08:07:03 PDT 1997
>Originator:     Tim Vanderhoek
>Release:        FreeBSD 2.2.2-RELEASE i386
>Organization:
Syscons users
>Environment:

FreeBSD 2.2.2-RELEASE.
Award PCI/ISA Bios.  2A59CG0P
GENERIC kernel

I suspect that this is irrelevent.

>Description:

I use a modified keyboard map.  /usr/share/syscons/keymaps/my.map
has the following line modified,

  090   cr     rctrl  rctrl  rctrl  rctrl  rctrl  rctrl  rctrl   O

When I act as described in "How-To-Repeat", syscons will begin thinking
that one of the ctrl keys is always pressed.  ie. pressing a `d' sends
^D.  It then becomes necessary to reboot (since the computer is quite
unusable).  If X is running, it, of course, is not affected.

This did not happen (I don't _believe_ it happened) in the SNAP of 2.2
that I had been running before.

I could not find any open prs that looked related.  The only modification
to syscons.c I found that might be relevant was 1.98.


>How-To-Repeat:

kbdcontrol -l /usr/share/syscons/keymaps/my.map ; # Where my.map has 090 -> cr
                                                  # Copy line from Description
  # Now, press the lctrl key, hold it down, and then press the rctrl key
  # Now, press `d' (or any key, for that matter), and you will be logged out.
  # Warning...  You will have to reboot to return syscons to its normal
  # state...


>Fix:

sos?  ;)
>Release-Note:
>Audit-Trail:

From: Tim Vanderhoek <hoek@hwcn.org>
To: timmmyymymy <hoek@hwcn.org>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG, freebsd-bugs@hub.freebsd.org
Subject: Re: i386/4030: syscons thinks CTRL is always pressed
Date: Fri, 4 Jul 1997 12:55:45 -0400 (EDT)

 On Fri, 4 Jul 1997, timmmyymymy wrote:
 
 > kbdcontrol -l /usr/share/syscons/keymaps/my.map ; # Where my.map has 090 -> cr
 >                                                   # Copy line from Description
 >   # Now, press the lctrl key, hold it down, and then press the rctrl key
 >   # Now, press `d' (or any key, for that matter), and you will be logged out.
 >   # Warning...  You will have to reboot to return syscons to its normal
 >   # state...
 
 It might be worthwhile to mention that you can still enter
 non-control characters by using the Alt-code.  eg. Alt-1-0-0.
 
 
 --
 Outnumbered?  Maybe.  Outspoken?  Never!
 tIM...HOEk
 

From: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
To: ac199@hwcn.org
Cc: FreeBSD-gnats-submit@freebsd.org, yokota@zodiac.mech.utsunomiya-u.ac.jp
Subject: Re: i386/4030: syscons thinks CTRL is always pressed 
Date: Mon, 07 Jul 1997 12:49:25 +0900

 >>Number:         4030
 >>Category:       i386
 >>Synopsis:       syscons thinks CTRL pressed, must reboot [repeatable]
 >>Confidential:   no
 >>Severity:       critical
 >>Priority:       medium
 >>Responsible:    freebsd-bugs
 >>State:          open
 >>Class:          sw-bug
 >>Submitter-Id:   current-users
 >>Arrival-Date:   Fri Jul  4 06:20:01 PDT 1997
 >>Last-Modified:
 >>Originator:     Tim Vanderhoek
 >>Organization:
 >Syscons users
 >>Release:        FreeBSD 2.2.2-RELEASE i386
 [snip]
 >>Description:
 >
 >I use a modified keyboard map.  /usr/share/syscons/keymaps/my.map
 >has the following line modified,
 >
 >  090   cr     rctrl  rctrl  rctrl  rctrl  rctrl  rctrl  rctrl   O
 >
 >When I act as described in "How-To-Repeat", syscons will begin thinking
 >that one of the ctrl keys is always pressed.  ie. pressing a `d' sends
 >^D.  It then becomes necessary to reboot (since the computer is quite
 >unusable).  If X is running, it, of course, is not affected.
 
 Try this patch for /sys/i386/isa/syscons.c.
 
 --- syscons.c-1.220	Mon Jun 30 22:31:49 1997
 +++ syscons.c	Mon Jul  7 12:35:14 1997
 @@ -3039,7 +3039,7 @@
      /* Check for make/break */
      action = key->map[state];
      if (scancode & 0x80) {      /* key released */
 -	if (key->spcl & 0x80) {
 +	if (key->spcl & (0x80>>state)) {
  	    switch (action) {
  	    case LSH:
  		shfts &= ~1;
 
 
 
 >This did not happen (I don't _believe_ it happened) in the SNAP of 2.2
 >that I had been running before.
 
 If the above patch works, then the problem did happen in the past too, 
 I guess.
 
 Kazu
 
 

From: Tim Vanderhoek <hoek@hwcn.org>
To: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: i386/4030: syscons thinks CTRL is always pressed 
Date: Wed, 9 Jul 1997 14:32:57 -0400 (EDT)

 On Mon, 7 Jul 1997, Kazutaka YOKOTA wrote:
 
 > >>Number:         4030
 > >>Category:       i386
 > >>Synopsis:       syscons thinks CTRL pressed, must reboot [repeatable]
 
 > Try this patch for /sys/i386/isa/syscons.c.
 > 
 > --- syscons.c-1.220	Mon Jun 30 22:31:49 1997
 > +++ syscons.c	Mon Jul  7 12:35:14 1997
 > @@ -3039,7 +3039,7 @@
 >      /* Check for make/break */
 >      action = key->map[state];
 >      if (scancode & 0x80) {      /* key released */
 > -	if (key->spcl & 0x80) {
 > +	if (key->spcl & (0x80>>state)) {
 >  	    switch (action) {
 >  	    case LSH:
 >  		shfts &= ~1;
 > 
 > 
 > >This did not happen (I don't _believe_ it happened) in the SNAP of 2.2
 > >that I had been running before.
 > 
 > If the above patch works, then the problem did happen in the past too, 
 > I guess.
 
 Okay, the patch works.  However, I can still reproduce the
 problem if I use a slight variation on the first keymap.
 
   090   cr     rctrl  nl     nl     rctrl  rctrl  nl     nl	O
 
 Press and hold Alt, then press rctrl.  Release all keys.  Then
 press `d' or whatever and you'll log out.
 
 [If X is running, you can switch to X and then switch back to
 your text console and the keyboard state will return to normal]
 
 The patch, as shown, is good enough for me, since the keymap one
 would have to use to reproduce the bug now is not very useful
 (for me, anyways).
 
 
 --
 Outnumbered?  Maybe.  Outspoken?  Never!
 tIM...HOEk
 

From: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp>
To: hoek@hwcn.org
Cc: FreeBSD-gnats-submit@freebsd.org, yokota@zodiac.mech.utsunomiya-u.ac.jp
Subject: Re: i386/4030: syscons thinks CTRL is always pressed 
Date: Thu, 10 Jul 1997 08:43:34 +0900

 >> >>Number:         4030
 >> >>Category:       i386
 >> >>Synopsis:       syscons thinks CTRL pressed, must reboot [repeatable]
 
 [...]
 
 >Okay, the patch works.  However, I can still reproduce the
 >problem if I use a slight variation on the first keymap.
 >
 
    scan                       cntrl          alt    alt   cntrl lock
    code  base   shift  cntrl  shift  alt    shift  cntrl  shift state
 >  090   cr     rctrl  nl     nl     rctrl  rctrl  nl     nl	O
 >
 >Press and hold Alt, then press rctrl.  Release all keys.  Then
 >press `d' or whatever and you'll log out.
 
 Well, it depends on which key you release first!!  If you press Alt
 then right Ctrl, syscons picks up the fifth field, thinks `rctrl' is
 down and set the internal ctrl bit .
 
 Then, if you release Ctrl first, then Alt, syscons correctly picks up
 the fifth field again, thinks `rctrl' is released, and clears the
 internal ctrl bit.
 
 But, if you release Alt first, then Ctrl, syscons picks up the first
 field, and thinks `cr' is released.  The internal ctrl bit remains
 set....
 
 A tricky bug.  But, at the same time I wonder this bug should be
 attributed to this rather strange keymap entry...
 
 >The patch, as shown, is good enough for me, since the keymap one
 >would have to use to reproduce the bug now is not very useful
 >(for me, anyways).
 
 Kazu
State-Changed-From-To: open->closed 
State-Changed-By: yokota 
State-Changed-When: Tue Jul 15 08:04:52 PDT 1997 
State-Changed-Why:  
Fix committed (1.224 in -current and 1.182.2.24 in RELENG_2_2). 
>Unformatted:
