Bug 200032 - Race between VT and X11
Summary: Race between VT and X11
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Hans Petter Selasky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-07 19:58 UTC by Hans Petter Selasky
Modified: 2015-05-21 07:34 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hans Petter Selasky freebsd_committer freebsd_triage 2015-05-07 19:58:43 UTC
Hi,

Sometimes when logging into X11 the keyboard input is not working. Pressing ALT+F9 makes it work. Any idea where the race is?

Kevin Oberman writes:
Actually, I have found that switching to ANY other terminal (e.g. ALT-F2)
and back to vty1 does the job.

--HPS
Comment 1 Hans Petter Selasky freebsd_committer freebsd_triage 2015-05-07 20:14:44 UTC
Suspect: Dirty keyboard modifier(s) when Xorg starts. ALT modifier is pressed for example.
Comment 2 Hans Petter Selasky freebsd_committer freebsd_triage 2015-05-07 20:59:51 UTC
Hi,

It might look like you can reproduce like this:

1) Boot computer into GDM / slim.
2) Wait more than 15 seconds.
3) Keyboard appears frozen.
4) Press ALT+F9
5) Keyboard works again.

If waiting less than 15 seconds everything is fine. Might be related to "vw_proc_dead_timer" in VT.

--HPS
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-05-08 16:19:20 UTC
A commit references this bug:

Author: hselasky
Date: Fri May  8 16:19:02 UTC 2015
New revision: 282645
URL: https://svnweb.freebsd.org/changeset/base/282645

Log:
  Prevent switching to NULL or own window in the "vt_proc_window_switch"
  function. This fixes an issue where X11 keyboard input can appear
  stuck. The cause of the problem is a duplicate TTY device window
  switch IOCTL during boot, which leaves the "vt_switch_timer" running,
  because the current window is already selected. While at it factor out
  some NULL checks.

  PR:			200032
  Differential Revision:	https://reviews.freebsd.org/D2480
  Reported by:		several people
  MFC after:		1 week
  Reviewed by:		emaste

Changes:
  head/sys/dev/vt/vt_core.c
Comment 4 Hans Petter Selasky freebsd_committer freebsd_triage 2015-05-08 16:20:12 UTC
https://reviews.freebsd.org/D2480
Comment 5 commit-hook freebsd_committer freebsd_triage 2015-05-21 07:34:51 UTC
A commit references this bug:

Author: hselasky
Date: Thu May 21 07:34:09 UTC 2015
New revision: 283187
URL: https://svnweb.freebsd.org/changeset/base/283187

Log:
  MFC r282645, r282646 and r282730:
  * Prevent switching to NULL or own window in the "vt_proc_window_switch"
    function. This fixes an issue where X11 keyboard input can appear
    stuck. The cause of the problem is a duplicate TTY device window
    switch IOCTL during boot, which leaves the "vt_switch_timer" running,
    because the current window is already selected. While at it factor out
    some NULL checks.
  * The "SYSCTL_INT()" default value is only used for read only SYSCTLs
    and is not applicable unless the integer pointer is NULL. Set it to
    zero to avoid confusion. While at it remove extra semicolon at the end
    of the "VT_SYSCTL_INT()" macro.
  * Ensure the result from signed subtraction under modulus does not
    become negative.

  PR:			200032

Changes:
_U  stable/10/
  stable/10/sys/dev/vt/vt.h
  stable/10/sys/dev/vt/vt_core.c