Event handler drops some events when rate of incoming events is high

Bug #289907 reported by Denver Gingerich
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qt4-x11 (Ubuntu)
Fix Released
Undecided
Unassigned
Jaunty
Fix Released
Undecided
Unassigned

Bug Description

The Qt event handler seems to drop events when lots of events are sent to it in a short amount of time.

I created a pair of test programs that demonstrates the problem. You can find them at:

http://ossguy.com/eventtest/
http://ossguy.com/eventtest.tar.gz (same contents as the above directory)

The information to reproduce the problem is in README. The sendkey program takes in keys from stdin and sends corresponding X events to eventtest, which buffers the keys and prints them to stdout every time a Return event is received. You will (hopefully) see that the input to sendkey does not match the output of eventtest (which is missing characters).

As an example, given the following input to sendkey...

ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890,./;'[]
ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890,./;'[]
ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890,./;'[]
ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890,./;'[]
ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890,./;'[]
ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890,./;'[]

...the eventtest program might print the following (on the systems I tested)...

ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,./;'[]
ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789DEFGHIJKLMNOPQRSTUVWXYZ0123456789,./;'[]
ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCD7890,./;'[]
ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRS,./;'[]
DEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ012345678,./;'[]
TUVWXYZ0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,./;'[]

...which shows that a large number of events are being dropped.

I have been able to reproduce the problem on the following systems:
- Ubuntu 8.04.1 with Qt 4.3.4 on a 1.3 GHz Pentium M
- Ubuntu 8.04.1 with Qt 4.4.0 on a 1.1 GHz Pentium M

Other applications I've tested, including gedit, the GNOME Terminal, and KEdit, do not miss any events using a similar test methodology.

Related branches

Revision history for this message
Denver Gingerich (denver-ossguy) wrote :

The attached patch fixes the bug. The patch is from Bradley Hughes at Trolltech and was originally published on the qt-interest mailing list:

http://lists.trolltech.com/qt-interest/2008-10/thread00773-0.html#msg00844

Additionally, I have reproduced this bug using the libqt4-dev 4.4.3 package included in the Ubuntu 8.10 repositories.

A Trolltech software engineer confirmed by private e-mail that this fix will be in Qt 4.5. I would recommend that it also be applied to Ubuntu's Qt 4.4.3 package so that users of Ubuntu 8.10 can benefit from it immediately.

Revision history for this message
Denver Gingerich (denver-ossguy) wrote :

All that's left is to commit the attached patch to Ubuntu's Qt package.

Changed in qt4-x11:
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qt4-x11 - 4.4.3-2ubuntu2

---------------
qt4-x11 (4.4.3-2ubuntu2) jaunty; urgency=low

  * Add kubuntu_09_event_reordering_fix.diff from Qt Software.
    Closes LP: #289907 "Event handler drops some events when rate of
    incoming events is high"

 -- Jonathan Riddell <email address hidden> Tue, 10 Feb 2009 17:52:12 +0000

Changed in qt4-x11:
status: In Progress → Fix Released
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.