Keyboard input processed twice, both on vt1 and vt7

Bug #782171 reported by Roman Fiedler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
virtualbox-ose (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: xserver-xorg-core

When booting a minimal natty x desktop with xdm and fvwm, the keyboard input is sent both to the X server running on vt7 and tty1. The result is, that the following xdm login occurs both on X and tty1. Since tty1 is faster, x keyboard input causes quite funny behavior of commands, e.g.

$ touch file; rm file
rm: cannot remove `file': No such file or directory

Example: ps aux executed twice in two sessions (737 is tty1 login, 790 bash in xterm)

root 701 0.8 3.8 14676 9560 tty7 Ss+ 11:54 0:03 /usr/bin/Xorg :0 vt7 -nolisten tcp -auth /var/lib/xdm/authdir/authfiles/A:0-ElV5qU
root 711 0.0 0.5 2784 1392 tty1 Ss 11:54 0:00 /bin/login --
root 714 0.0 1.5 8124 3864 ? Ss 11:54 0:00 -:0
user 732 0.0 1.6 13816 4172 ? Ss 11:54 0:00 x-window-manager
user 737 0.0 0.8 4800 2004 tty1 S 11:54 0:00 -bash
user 778 0.0 0.0 3368 188 ? Ss 11:54 0:00 /usr/bin/ssh-agent x-window-manager
user 788 0.0 2.5 11368 6380 ? S 11:54 0:00 xterm
user 790 0.0 0.7 4788 1964 pts/0 Ss 11:54 0:00 bash
user 1007 0.0 0.4 4156 1200 tty1 R+ 12:00 0:00 ps aux
user 1008 0.0 0.4 4156 1200 pts/0 R+ 12:00 0:00 ps aux

To issue an exit in only xterm or tty1, one may use two xterms and combination of letters and delkey to produce incomplete/invalid

When connecting via ssh, X is running on vt7, active console is 1

root 710 0.1 3.7 14544 9440 tty7 Ss+ 10:49 0:03 /usr/bin/Xorg :0 vt7 -nolisten tcp -auth /var/lib/xdm/authdir/authfiles/A:0-mXcrL2

ssh# fgconsole
1

At logoff or when using "chvt 7" via ssh, X server aborts without specific error message

[ 3491.811] (EE) VBoxVideo(0): Unable to determine whether the virtual machine supports mouse pointer integration - request initialization failed with return code -4
[ 3523.678]
Backtrace:
[ 3523.678] 0: /usr/bin/Xorg (xorg_backtrace+0x3b) [0x80eab1b]
[ 3523.678] 1: /usr/bin/Xorg (0x8048000+0x5fac8) [0x80a7ac8]
[ 3523.678] 2: (vdso) (__kernel_rt_sigreturn+0x0) [0x72040c]
[ 3523.678] 3: /usr/bin/Xorg (0x8048000+0x27f1e) [0x806ff1e]
[ 3523.678] 4: /usr/bin/Xorg (0x8048000+0x1a81c) [0x806281c]
[ 3523.679] 5: /lib/i386-linux-gnu/libc.so.6 (__libc_start_main+0xe7) [0x562e37]
[ 3523.679] 6: /usr/bin/Xorg (0x8048000+0x1a411) [0x8062411]
[ 3523.679]
Caught signal 3 (Quit). Server aborting
[ 3523.679]

This leaves random garbage in all 16 vga-colors on vt1 to vt7, sometimes with font also distorted.

Afterwards, xserver on vt7 and tty1 are independent, no keyboard input duplication any more

I am not sure, if the error occurs in the vt-initialization, in xserver core or in virtualbox graphics adapter, so I start with a report here. A similar setup on lucid worked without problems, maverick was not tested.

# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=11.04
DISTRIB_CODENAME=natty
DISTRIB_DESCRIPTION="Ubuntu 11.04"

# apt-cache policy xserver-xorg-core
xserver-xorg-core:
  Installed: 2:1.10.1-1ubuntu1
  Candidate: 2:1.10.1-1ubuntu1
  Version table:
 *** 2:1.10.1-1ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ natty/main i386 Packages
        100 /var/lib/dpkg/status

Tags: natty
Bryce Harrington (bryce)
tags: added: natty
affects: xorg-server (Ubuntu) → virtualbox-ose (Ubuntu)
Revision history for this message
Michael Thayer (michael-thayer) wrote :

I wouldn't have thought that the keyboard issue is related to VirtualBox, as we simply emulate a standard PS/2 keyboard which should be handled in the kernel and transparent to the layers above. The X server crash might be - I assume that you have vboxvideo loaded into both servers, and having it running twice has been tested, but not extensively. On the other hand, I usually expect to see vboxvideo at least somewhere in the backtrace if it is related to the problem. If this is still relevant to you would you be able to tell us what version of the VirtualBox guest additions you have installed and provide Xorg.*.log files for both X servers? Note that we fixed a bug in version 4.1.4 of the Additions which can cause text console corruption when switching out of an X server.

Revision history for this message
Roman Fiedler (roman-fiedler-deactivatedaccount) wrote :

This is getting really problematic: I also observed the issue on the base machine, not only within virtualbox guest. The effect there is in most cases that an open login session remains on tty1, that contains the passwords in plaintext in some .vim file. Cause:

During double command execution, quite some commands work even when executed twice, e.g. "ls". Since graphical desktop contains multiple xterms, but all commands on tty1 are executed in one shell, thus some combinations do not make sense any more (e.g. the GUI combination xterm1: "cd tmp"; xterm2: "su -s /bin/bash \n dhclient eth0\n cd \"; xterm1: "rm -rf -- *" might be the most lethal leading to complete data loss).

On my machine, quite some events ended with vim open on tty1 in some exotic mode. When I lock the graphical desktop and leave the machine, tty1 will be still open to anyone who knows about the problem and vim might contain username/password or sudo/ssh-keypassphrases in plaintext in vim edit mode.

Workaround (has worked so far):

Press [Ctrl]-C on xdm login screen, this restarts xdm. Afterwards tty1/tty7 are uncoupled.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.