Mir sending key repeat events continually to nested shell after VT switch (causes Unity8 lockup for a while)

Bug #1675357 reported by Michał Sawicz
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical System Image
In Progress
High
Stephen M. Webb
Mir
Fix Released
High
Andreas Pokorny
0.26
Fix Released
High
Andreas Pokorny
mir (Ubuntu)
Fix Released
High
Andreas Pokorny
Xenial
Fix Released
Undecided
Unassigned
Yakkety
Fix Released
Undecided
Unassigned
Zesty
Fix Released
Undecided
Unassigned
qtmir (Ubuntu)
Invalid
Undecided
Unassigned
Xenial
Invalid
Undecided
Unassigned
unity8 (Ubuntu)
Invalid
High
Unassigned
Xenial
Invalid
Undecided
Unassigned

Bug Description

Steps:
* log in to unity8
* Ctrl+Alt+F* to a different vt, or log in to a different user session
* go back to the unity8 vt

Expected:
* session is locked, but working

Current:
* unity8 starts spinning for a time proportional to the period it was inactive
* if it was inactive long enough, it doesn't seem to recover at all

It seems it's "catching up" in some way, maybe with input, maybe frames.

ProblemType: Bug
DistroRelease: Ubuntu 17.04
Package: unity8 8.15+17.04.20170321-0ubuntu1 [origin: LP-PPA-ci-train-ppa-service-2555]
ProcVersionSignature: Ubuntu 4.10.0-13.15-generic 4.10.1
Uname: Linux 4.10.0-13-generic x86_64
NonfreeKernelModules: zfs zunicode zavl zcommon znvpair
ApportVersion: 2.20.4-0ubuntu2
Architecture: amd64
CurrentDesktop: Unity:Unity7
Date: Thu Mar 23 11:36:39 2017
InstallationDate: Installed on 2016-05-06 (320 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
SourcePackage: unity8
UpgradeStatus: Upgraded to zesty on 2016-11-22 (120 days ago)

Causes:
The mir::input::KeyRepeatDispatcher is running inside the nested mirserver even though there is another instance running inside the host server. A few months ago qtmir used to replace the key repeater by replacing mirs dispatcher. And key repeat is not disabled within the nested server. So both the host and the nested server are producing repeat events.
  Now due to a logic error inside mirserver the key repeat dispatcher is not hooked up to the input device hub when running inside the nested server. The input device hub would tell the key repeater when devices get removed - i.e. due to vt switching. So it never notices that the devices go away continues to produce those events indefinitely.

This applies to all currently pressed buttons. I.e. you can open an edit field and press 'w' while simultaneously pressing Ctrl+Alt+FX to switch to another VT. On return 'w' will be repeated indefinitely.

Revision history for this message
Michał Sawicz (saviq) wrote :
Changed in canonical-devices-system-image:
status: New → Confirmed
status: Confirmed → Triaged
importance: Undecided → High
assignee: nobody → Michał Sawicz (saviq)
milestone: none → u8c-z
Revision history for this message
Michał Sawicz (saviq) wrote :

This is a `perf report` from just 3-4s around reactivating a unity8 vt:

  18,33% Mir/Input Reade libc-2.24.so [.] malloc
   5,42% unity8 libQt5Core.so.5.7.1 [.] _ZL28qMetaTypeCustomType_unlockedPKciPi.constprop.817
   4,55% MirServerThread libglib-2.0.so.0.5105.0 [.] g_main_context_dispatch
   3,44% unity8 libQt5Qml.so.5.7.1 [.] _ZN3QV413InternalClass4findEPKNS_6StringE
   2,34% unity8 libQt5Qml.so.5.7.1 [.] _ZNK3QV414QObjectWrapper12findPropertyEPNS_15ExecutionEngineEP15QQmlContextDataPNS_6StringENS0_12RevisionModeEP16QQmlPropertyData
   2,31% unity8 libQt5Qml.so.5.7.1 [.] _ZN3QV413MemoryManager9allocDataEmm
   1,83% unity8 libc-2.24.so [.] _int_free
   1,56% unity8 libQt5Qml.so.5.7.1 [.] _ZN11QQmlBinding6updateE6QFlagsIN19QQmlPropertyPrivate9WriteFlagEE

Revision history for this message
Gerry Boland (gerboland) wrote :

Turning on input event printing[1], when using Ctrl+Alt+F1 switching away from unity8, I see a continuous stream of input events being sent from Mir to Unity8, while on VT1:

[2017-03-23:12:36:53.419] qtmir.mir.input: Received MirKeyboardEvent(action=repeat,key_code=0x1008ff2b). Dispatching to ShellView(0x558b6b947ea0)
[2017-03-23:12:36:53.428] qtmir.mir.input: Received MirKeyboardEvent(action=repeat,key_code=0xffe9). Dispatching to ShellView(0x558b6b947ea0)
[2017-03-23:12:36:53.444] qtmir.mir.input: Received MirKeyboardEvent(action=repeat,key_code=0xffe3). Dispatching to ShellView(0x558b6b947ea0)
[2017-03-23:12:36:53.470] qtmir.mir.input: Received MirKeyboardEvent(action=repeat,key_code=0x1008ff2b). Dispatching to ShellView(0x558b6b947ea0)
[2017-03-23:12:36:53.480] qtmir.mir.input: Received MirKeyboardEvent(action=repeat,key_code=0xffe9). Dispatching to ShellView(0x558b6b947ea0)
[2017-03-23:12:36:53.495] qtmir.mir.input: Received MirKeyboardEvent(action=repeat,key_code=0xffe3). Dispatching to ShellView(0x558b6b947ea0)
[2017-03-23:12:36:53.521] qtmir.mir.input: Received MirKeyboardEvent(action=repeat,key_code=0x1008ff2b). Dispatching to ShellView(0x558b6b947ea0)
[2017-03-23:12:36:53.531] qtmir.mir.input: Received MirKeyboardEvent(action=repeat,key_code=0xffe9). Dispatching to ShellView(0x558b6b947ea0)

and actually, switching back to Unity8's VT, the key repeat events don't stop! Adding Mir to the bug

[1] qdbus com.canonical.Unity8 /com/canonical/Unity8/Debugging com.canonical.Unity8.Debugging.SetLoggingFilterRules "qtmir.mir.input=true"

summary: - Unity8 spins for a long time after being on an inactive vt
+ Mir sending key repeat events continually to nested shell after VT
+ switch (causes Unity8 lockup for a while)
Changed in unity8 (Ubuntu):
status: Triaged → Invalid
Michał Sawicz (saviq)
Changed in canonical-devices-system-image:
assignee: Michał Sawicz (saviq) → Stephen M. Webb (bregma)
Stephen M. Webb (bregma)
Changed in mir (Ubuntu):
assignee: nobody → Andreas Pokorny (andreas-pokorny)
Revision history for this message
Gerry Boland (gerboland) wrote :

Was suspecting this is bug 1536279 but they don't quite match either

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

AFAIK the same Mir Input Reader thread is causing high CPU bug 1671731 also. Might be related.

Changed in mir:
assignee: nobody → Andreas Pokorny (andreas-pokorny)
importance: Undecided → High
Changed in mir (Ubuntu):
importance: Undecided → High
tags: added: performance
description: updated
Changed in mir:
status: New → In Progress
milestone: none → 1.0.0
description: updated
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

Fix committed into lp:mir at revision None, scheduled for release in mir, milestone 1.0.0

Changed in mir:
status: In Progress → Fix Committed
Changed in qtmir (Ubuntu):
status: New → Invalid
Changed in mir (Ubuntu):
status: New → Invalid
status: Invalid → New
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Fix committed to lp:mir/0.26 at revision 4050, scheduled for release in Mir 0.26.3 (if that gets released at all)

Changed in canonical-devices-system-image:
status: Triaged → Fix Committed
Revision history for this message
Stephen M. Webb (bregma) wrote :

This should not be set to Fix Committed on system images until it's available on System Images.

Changed in canonical-devices-system-image:
status: Fix Committed → In Progress
Changed in mir (Ubuntu):
status: New → Triaged
Timo Aaltonen (tjaalton)
Changed in qtmir (Ubuntu Xenial):
status: New → Invalid
Changed in unity8 (Ubuntu Xenial):
status: New → Invalid
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Michał, or anyone else affected,

Accepted mir into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mir/0.26.3+16.04.20170510-0ubuntu1 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 to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

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

Changed in mir (Ubuntu Xenial):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

Tested version 0.26.3+16.04.20170510-0ubuntu1

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

This bug was fixed in the package mir - 0.26.3+17.10.20170526.3-0ubuntu1

---------------
mir (0.26.3+17.10.20170526.3-0ubuntu1) artful; urgency=medium

  [ Daniel van Vugt ]
  * New upstream release 0.26.3 (https://launchpad.net/mir/+milestone/0.26.3)
    - Enhancements:
      . Make deprecations optional (and default to off for builds on 16.04 LTS)
      . Added support for building on Ubuntu 17.10 artful.
    - Bugs fixed:
      . Mir needs to be updated to 0.26 in 16.04LTS (LP: #1685186)
      . unity-system-compositor crashed with SIGSEGV in
        libinput_device_config_accel_is_available() from
        libinput_device_config_accel_set_speed() from
        mir::input::evdev::LibInputDevice::apply_settings() (LP: #1672955)
      . Please transition to Boost 1.62 (LP: #1675138)
      . Mir sending key repeat events continually to nested shell after VT
        switch (causes Unity8 lockup for a while) (LP: #1675357)
      . mir_demo_standalone_render_overlays fails to link (LP: #1677239)

 -- Alan Griffiths <email address hidden> Fri, 26 May 2017 16:57:20 +0000

Changed in mir (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote :

Hello Michał, or anyone else affected,

Accepted mir into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mir/0.26.3+16.04.20170605-0ubuntu1 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 to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

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

tags: removed: verification-done
tags: added: verification-needed
Changed in mir (Ubuntu Yakkety):
status: New → Fix Committed
Revision history for this message
Chris Halse Rogers (raof) wrote :

Hello Michał, or anyone else affected,

Accepted mir into yakkety-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mir/0.26.3+16.10.20170605-0ubuntu1 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 to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

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

Revision history for this message
Chris Halse Rogers (raof) wrote :

Hello Michał, or anyone else affected,

Accepted mir into zesty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/mir/0.26.3+17.04.20170605-0ubuntu1 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 to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

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

Changed in mir (Ubuntu Zesty):
status: New → Fix Committed
Revision history for this message
Michał Sawicz (saviq) wrote :

Tested:
xenial: 0.26.3+16.04.20170605-0ubuntu1
yakkety: 0.26.3+16.10.20170605-0ubuntu1
zesty: 0.26.3+17.04.20170605-0ubuntu1

All is fine.

tags: added: verification-done
removed: verification-needed
tags: added: verification-done-xenial verification-done-yakkety verification-done-zesty
removed: verification-done
Revision history for this message
Andy Whitcroft (apw) wrote : Update Released

The verification of the Stable Release Update for mir 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.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mir - 0.26.3+16.10.20170605-0ubuntu1

---------------
mir (0.26.3+16.10.20170605-0ubuntu1) yakkety; urgency=medium

  [ Daniel van Vugt ]
  * New upstream release 0.26.3 (https://launchpad.net/mir/+milestone/0.26.3)
    - Enhancements:
      . Make deprecations optional (and default to off for builds on 16.04 LTS)
      . Added support for building on Ubuntu 17.10 artful.
    - Bugs fixed:
      . Mir needs to be updated to 0.26 in 16.04LTS (LP: #1685186)
      . unity-system-compositor crashed with SIGSEGV in
        libinput_device_config_accel_is_available() from
        libinput_device_config_accel_set_speed() from
        mir::input::evdev::LibInputDevice::apply_settings() (LP: #1672955)
      . Please transition to Boost 1.62 (LP: #1675138)
      . Mir sending key repeat events continually to nested shell after VT
        switch (causes Unity8 lockup for a while) (LP: #1675357)
      . mir_demo_standalone_render_overlays fails to link (LP: #1677239)

 -- Michał Sawicz <email address hidden> Mon, 05 Jun 2017 13:46:05 +0000

Changed in mir (Ubuntu Yakkety):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mir - 0.26.3+16.04.20170605-0ubuntu1

---------------
mir (0.26.3+16.04.20170605-0ubuntu1) xenial; urgency=medium

  [ Daniel van Vugt ]
  * New upstream release 0.26.3 (https://launchpad.net/mir/+milestone/0.26.3)
    - Enhancements:
      . Make deprecations optional (and default to off for builds on 16.04 LTS)
      . Added support for building on Ubuntu 17.10 artful.
    - Bugs fixed:
      . Mir needs to be updated to 0.26 in 16.04LTS (LP: #1685186)
      . unity-system-compositor crashed with SIGSEGV in
        libinput_device_config_accel_is_available() from
        libinput_device_config_accel_set_speed() from
        mir::input::evdev::LibInputDevice::apply_settings() (LP: #1672955)
      . Please transition to Boost 1.62 (LP: #1675138)
      . Mir sending key repeat events continually to nested shell after VT
        switch (causes Unity8 lockup for a while) (LP: #1675357)
      . mir_demo_standalone_render_overlays fails to link (LP: #1677239)

 -- Michał Sawicz <email address hidden> Mon, 05 Jun 2017 11:01:05 +0000

Changed in mir (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mir - 0.26.3+17.04.20170605-0ubuntu1

---------------
mir (0.26.3+17.04.20170605-0ubuntu1) zesty; urgency=medium

  [ Daniel van Vugt ]
  * New upstream release 0.26.3 (https://launchpad.net/mir/+milestone/0.26.3)
    - Enhancements:
      . Make deprecations optional (and default to off for builds on 16.04 LTS)
      . Added support for building on Ubuntu 17.10 artful.
    - Bugs fixed:
      . Mir needs to be updated to 0.26 in 16.04LTS (LP: #1685186)
      . unity-system-compositor crashed with SIGSEGV in
        libinput_device_config_accel_is_available() from
        libinput_device_config_accel_set_speed() from
        mir::input::evdev::LibInputDevice::apply_settings() (LP: #1672955)
      . Please transition to Boost 1.62 (LP: #1675138)
      . Mir sending key repeat events continually to nested shell after VT
        switch (causes Unity8 lockup for a while) (LP: #1675357)
      . mir_demo_standalone_render_overlays fails to link (LP: #1677239)

 -- Michał Sawicz <email address hidden> Mon, 05 Jun 2017 11:04:47 +0000

Changed in mir (Ubuntu Zesty):
status: Fix Committed → Fix Released
Changed in mir:
status: Fix Committed → 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.