Subject: 24.3; keystrokes come out of order

From: [email-masked]
Date: Fri, 10 Oct 2014 22:41:36 +0000 (GMT)

When typing quickly, the charaters from keystrokes come out of order.
For example typing 'f' 'o' 'r' 't' may come out as "ofrt" or sometimes
fully inverse "trof" or some other combination.

Typing faster makes the problem more likely to reproduce, but even
quite normal typing speed has problems.

Higher system load makes the problem more likely, but it manifests
with load levels as low as 0.25.

The problem is more prominent in buffers that have onerous font-lock
configurations. E.g. the default syntax highlighting of c-mode
makes the problem 4 times as likely as fundamental-mode.

It seems to me that somehow the input queue processing is not
strictly FIFO. Instead, the characters that pile up while other
process is running, are all rendered in inverse order at some
later time after some newer characters have already been rendered.

Restarting emacs process gives temporary relief, but the problem will
come back after a few hours of typing.

The problem does not manifest on emacs21 on similar hardware (1GHz CPU
lowend laptop) and similar Ubuntu version. In fact, ever since I started
using emacs back in 1987, I have not had such an annoying problem.
Getting typing out-of-order really destroys your productivity.

There are no dropped or out of order keys in other applications
I use, such as seamonkey (typing lengthy emails to web mail forms),
RetroShare (typing chat messages fast) or mrxvt (typing shell
commands fast and using emacs in remote machines).

I tried reviewing bug archives at http://debbugs.gnu.org/Emacs.html
to no avail (perhaps I did not have the imagination to think up
the keyword that would match previous instances of this bug). I also
tried google with similarily thin results.

Cheers,
--Sampo

In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7)
 of 2014-03-07 on lamiak, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11501000
System Description:	Ubuntu 14.04.1 LTS

Configured using:
 `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu'
 '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
 '--localstatedir=/var/lib' '--infodir=/usr/share/info'
 '--mandir=/usr/share/man' '--with-pop=yes'
 '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp'
 '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes'
 '--with-x-toolkit=gtk3' '--with-toolkit-scroll-bars'
 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector
 --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall'
 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro'
 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LC_MONETARY: de_BE.UTF-8
  value of $LC_NUMERIC: de_BE.UTF-8
  value of $LC_TIME: de_BE.UTF-8
  value of $LANG: C
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: nil
  default enable-multibyte-characters: t

Major mode: C/l

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent input:
<down-mouse-1> <mouse-movement> <mouse-movement> <drag-mouse-1> 
<switch-frame> <help-echo> <help-echo> <switch-frame> 
<down-mouse-2> <mouse-2> <switch-frame> <switch-frame> 
<return> <return> O r d e r SPC I D : SPC <down-mouse-2> 
<mouse-2> C-x C-s <return> <return> C-x C-s C-x C-s 
<switch-frame> <help-echo> <switch-frame> 1 7 7 3 C-a 
U S D SPC $ C-e . 3 7 SPC ( U S D / J P Y SPC = SPC 
1 0 7 . 6 7 5 ) C-x C-s C-x C-s C-x C-s <switch-frame> 
<switch-frame> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> <up> <up> C-a 
C-SPC <down> <down> <up> C-g <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <down> 
<down> <up> <up> <up> <up> <up> C-k C-k C-y <down> 
<down> <down> <down> <down> C-y <up> <tab> <down> C-k 
l c i e n t <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> i c l e <backspace> <backspace> 
<backspace> <backspace> <switch-frame> <switch-frame> 
c l i e n t _ i d <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <help-echo> <switch-frame> 
<switch-frame> <help-echo> SPC SPC = <backspace> <backspace> 
SPC = <backspace> <backspace> 1 2 3 SPC 4 3 2 1 <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> = SPC <down-mouse-1> <mouse-movement> 
<mouse-movement> <drag-mouse-1> <down-mouse-2> <mouse-2> 
<switch-frame> <switch-frame> C-s C-x <up> <up> <up> 
<up> C-a C-SPC <down> <down> <down> <down> <down> <down> 
C-w C-y C-y <up> <up> <up> <up> <up> <left> <left> 
<left> <left> <left> <left> <backspace> <backspace> 
c r e e s t <left> <left> <left> <right> <right> <backspace> 
<backspace> <left> <left> <left> s e <right> <right> 
C-x C-s C-x C-s <escape> x r e p o <tab> r <tab> <
return>

Recent messages:
Saving file /home/sampo/laptop...
Wrote /home/sampo/laptop
(No changes need to be saved) [2 times]
Mark set
Quit
Mark set [6 times]
Saving file /home/sampo/zxid/zxumacall.c...
Wrote /home/sampo/zxid/zxumacall.c
(No changes need to be saved)
Making completion list...

Load-path shadows:
/usr/share/emacs/24.3/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs24/site-lisp/latex-cjk-thai/thai-word hides /usr/share/emacs/24.3/lisp/language/thai-word

Features:
(shadow sort gnus-util mail-extr emacsbug message cl-macs gv format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils dired conf-mode grep shell pcomplete
compile etags make-mode nxml-uchnm rng-xsd xsd-regexp rng-cmpct rng-nxml
rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util
rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph
nxml-enc xmltok rect perl-mode face-remap sgml-mode sh-script smie
executable cc-langs cl cl-lib cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs vc-cvs misearch
multi-isearch vc-git help-mode easymenu bookmarknav bookmark pp
ds-debug-mode gud easy-mmode comint ansi-color ring sampo-kalenteri-mode
pd-mode ldif-mode header-db-mode time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
make-network-process dbusbind dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)