Qt5 incorrectly interpret keypresses from remote VNC keyboard

Bug #1831505 reported by Norbert
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qtbase-opensource-src (Debian)
Fix Released
Unknown
qtbase-opensource-src (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
Qt applications incorrectly interpret keyboard input when running over some VNC clients such as TightVNC.

[Test Case]
1. Have Ubuntu 18.04 LTS installed with VNC server
2. Connect to Ubuntu 18.04 LTS from other machine with VNC client
3. Launch any Qt5 based application such as `assistant`, `kate` or `retext`
4. Press keyboard combination on VNC client

Expected results:
all keypresses are recognized successfully

Actual results:
* <Shift> produces `1`
* <Alt> produces `5`
* <`> produces `p`
* <Delete> and <Backspace> are not working
* all letters are messed

[Proposed Fix]
The proposed fix is a backport of two upstream commits: the second being the actual fix, the first one is some refactoring of the code to make it easier to write the second. The commits are:

- https://code.qt.io/cgit/qt/qtbase.git/commit/?id=f8b164e1c37ca901
- https://code.qt.io/cgit/qt/qtbase.git/commit/?id=3edcd9420e3ad661

[Regression Potential]
Most of the new code is triggered only when the keymap is missing rules, models, or layout (i.e. rmlvo_is_incomplete == true). This minimizes the risk of regressions when working with simple X11 server. In any case, the potential regressions will be related to input handling.

[Other Info]
Note:
only Qt applications are affected, the GTK-based work as expected (including Chromium from which I write this bug-report)

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: qt5-assistant 5.9.5-0ubuntu1
Uname: Linux 4.4.78-perf+ aarch64
NonfreeKernelModules: wlan exfat
ApportVersion: 2.20.9-0ubuntu7
Architecture: armhf
CurrentDesktop: MATE
Date: Tue Jun 4 00:46:55 2019
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: qttools-opensource-src
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Norbert (nrbrtx) wrote :
Revision history for this message
Norbert (nrbrtx) wrote :

The CPU architecture is not the problem.
Got the same behavior on amd64 <-> amd64 connection with default settings of TightVNC server.

tags: added: amd64
Revision history for this message
Norbert (nrbrtx) wrote :
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

The Debian bug is marked as fixed in Qt 5.11. Can you please check if this bug is present in Disco (which has 5.12)?

Norbert (nrbrtx)
tags: added: cosmic
tags: added: xenial
removed: cosmic
Revision history for this message
Norbert (nrbrtx) wrote :

You are right, bug is fixed in Ubuntu 18.10 (cosmic) and 19.04 (disco).
I can type text in Kate even without XKB.

no longer affects: qttools-opensource-src (Ubuntu)
no longer affects: tightvnc (Ubuntu)
Changed in qtbase-opensource-src (Ubuntu):
status: New → Fix Released
Changed in qtbase-opensource-src (Debian):
status: Unknown → Fix Released
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Can you please try packages from https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/3731/+packages and see if they fix the issue?

Revision history for this message
Norbert (nrbrtx) wrote :

Just tested packages from your PPA on amd64. Problem is fixed.
Thank you!

It would be great if you SRU them to bionic.

Does the SRU for 16.04 possible?

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

It was quite difficult to backport this even to 18.04, as I had to change the code in several places to make it compile.

That was backporting only two releases back (5.11 → 5.9). 16.04 has 5.5 so that sounds impossible, however patches are welcome.

description: updated
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

The two patches seem a bit big (with all that refactoring), but I guess I didn't see any follow up changes to this code upstream. Also, with the regression potential well defined, I'm inclined to accept it.

Changed in qtbase-opensource-src (Ubuntu Bionic):
status: New → Fix Committed
tags: added: verification-needed verification-needed-bionic
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Norbert, or anyone else affected,

Accepted qtbase-opensource-src into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/qtbase-opensource-src/5.9.5+dfsg-0ubuntu2.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Łukasz Zemczak (sil2100) wrote : Autopkgtest regression report (qtbase-opensource-src/5.9.5+dfsg-0ubuntu2.3)

All autopkgtests for the newly accepted qtbase-opensource-src (5.9.5+dfsg-0ubuntu2.3) for bionic have finished running.
There have been regressions in tests triggered by the package. Please visit the sru report page and investigate the failures.

https://people.canonical.com/~ubuntu-archive/pending-sru.html#bionic

Revision history for this message
Norbert (nrbrtx) wrote :

Packages from bionic-proposed fix the issue.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

> Packages from bionic-proposed fix the issue.

Thanks, marking as verified then.

tags: added: verification-done verification-done-bionic
removed: verification-needed verification-needed-bionic
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qtbase-opensource-src - 5.9.5+dfsg-0ubuntu2.3

---------------
qtbase-opensource-src (5.9.5+dfsg-0ubuntu2.3) bionic; urgency=medium

  * Backport upstream patch to fix nullptr dereference in HTTP handler
    (LP: #1833536).

qtbase-opensource-src (5.9.5+dfsg-0ubuntu2.2) bionic; urgency=medium

  * Backport two upstream patches to support legacy X11 keymaps
    (LP: #1831505).

 -- Dmitry Shachnev <email address hidden> Thu, 20 Jun 2019 13:59:52 +0300

Changed in qtbase-opensource-src (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for qtbase-opensource-src has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.