Mir

[regression] mir_demo_server refuses to quit on Ctrl+Alt+Backspace or Ctrl+C in its terminal (deadlock in DefaultInputDeviceHub::add_device)

Bug #1661151 reported by Daniel van Vugt
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mir
Fix Released
High
Alan Griffiths
0.26
Invalid
High
Unassigned
mir (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

mir_demo_server refuses to quit on Ctrl+Alt+Backspace

It knows it should be quitting but doesn't, even when I try multiple times:

[2017-02-02 12:13:12.670302] mirserver: Stopping
[2017-02-02 12:13:13.070166] mirserver: Stopping
[2017-02-02 12:13:13.302165] mirserver: Stopping
[2017-02-02 12:13:13.510186] mirserver: Stopping
[2017-02-02 12:13:13.686165] mirserver: Stopping
[2017-02-02 12:13:13.870160] mirserver: Stopping
[2017-02-02 12:13:14.062330] mirserver: Stopping
[2017-02-02 12:13:14.254349] mirserver: Stopping
[2017-02-02 12:13:14.438335] mirserver: Stopping
[2017-02-02 12:13:14.622329] mirserver: Stopping
[2017-02-02 12:13:14.830312] mirserver: Stopping

Similarly, Ctrl+C no longer works:

[2017-02-10 11:16:18.643952] mirserver: Logical position +0+0
[2017-02-10 11:16:18.643955] mirserver: Output 52: HDMI-A disconnected
^C^C^C^C^C^C^C^C^C^C^C

Tags: regression

Related branches

Changed in mir:
importance: Undecided → Medium
Revision history for this message
Daniel van Vugt (vanvugt) wrote : Re: mir_demo_server refuses to quit on Ctrl+Alt+Backspace or Ctrl+C in its terminal

Bisected. The regression started here:

------------------------------------------------------------
revno: 4002 [merge]
author: Andreas Pokorny <email address hidden>
committer: Tarmac
branch nick: development-branch
timestamp: Wed 2017-02-01 17:32:36 +0000
message:
  mir_connection_apply_input_configuration and mir_connection_set_base_input_configuration

  This adds two new mirclient functions to configure input devices. The base input configuration behaves like the base display configuration.
  .

  Approved by Alan Griffiths, mir-ci-bot.
------------------------------------------------------------

summary: - mir_demo_server refuses to quit on Ctrl+Alt+Backspace
+ mir_demo_server refuses to quit on Ctrl+Alt+Backspace or Ctrl+C in its
+ terminal
Changed in mir:
milestone: none → 1.0.0
tags: added: regression
description: updated
summary: - mir_demo_server refuses to quit on Ctrl+Alt+Backspace or Ctrl+C in its
- terminal
+ [regression] mir_demo_server refuses to quit on Ctrl+Alt+Backspace or
+ Ctrl+C in its terminal
Changed in mir:
status: New → Triaged
Revision history for this message
Alan Griffiths (alan-griffiths) wrote : Re: [regression] mir_demo_server refuses to quit on Ctrl+Alt+Backspace or Ctrl+C in its terminal

The problem is that the main loop never exists. I'm guessing we now have a source that never shuts up.

Changed in mir:
assignee: nobody → Alan Griffiths (alan-griffiths)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :
Download full text (3.8 KiB)

This is the cause...

#0 __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
#1 0x00007f08e1a65ebd in __GI___pthread_mutex_lock (mutex=0x2823fd0) at ../nptl/pthread_mutex_lock.c:80
#2 0x00007f08e017e8e3 in __gthread_mutex_lock (__mutex=0x2823fd0)
    at /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/x86_64-linux-gnu/c++/6.3.0/bits/gthr-default.h:748
#3 0x00007f08e017eaa5 in std::mutex::lock (this=0x2823fd0)
    at /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/std_mutex.h:103
#4 0x00007f08e01a387c in std::unique_lock<std::mutex>::lock (this=0x7ffe8ab8edc8)
    at /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/std_mutex.h:267
#5 0x00007f08e019ea44 in std::unique_lock<std::mutex>::unique_lock (this=0x7ffe8ab8edc8, __m=...)
    at /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/std_mutex.h:197
#6 0x00007f08e0211697 in mir::input::DefaultInputDeviceHub::device_changed (this=0x2823fa0, dev=
    0x7f08c8014f80) at /home/alan/display_server/mir/src/server/input/default_input_device_hub.cpp:338

****************>>> std::unique_lock<std::mutex> lock(observer_guard);

#7 0x00007f08e0212820 in mir::input::DefaultInputDeviceHub::add_device(std::shared_ptr<mir::input::InputDevice> const&)::$_1::operator()(mir::input::Device*) const (this=0x7f08c8015068, d=0x7f08c8014f80)
    at /home/alan/display_server/mir/src/server/input/default_input_device_hub.cpp:78
#8 0x00007f08e02126d2 in std::_Function_handler<void (mir::input::Device*), mir::input::DefaultInputDeviceHub::add_device(std::shared_ptr<mir::input::InputDevice> const&)::$_1>::_M_invoke(std::_Any_data const&, mir::input::Device*&&) (__functor=...,
    __args=<unknown type in cmake-build-debug/bin/../lib/libmirserver.so.44, CU 0x17fea7, DIE 0x1984b4>)
    at /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/functional:1731
#9 0x00007f08e020cef8 in std::function<void (mir::input::Device*)>::operator()(mir::input::Device*) const
    (this=0x7f08c8015068, __args=0x7f08c8014f80)
    at /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/functional:2127
#10 0x00007f08e020b11b in mir::input::DefaultDevice::apply_pointer_configuration (this=0x7f08c8014f80,
    conf=...) at /home/alan/display_server/mir/src/server/input/default_device.cpp:136
#11 0x00007f08e091988b in mir::examples::InputDeviceConfig::device_added (this=0x2788a10, device=warning: RTTI symbol not found for class 'std::_Sp_counted_ptr_inplace<mir::input::DefaultDevice, std::allocator<mir::input::DefaultDevice>, (__gnu_cxx::_Lock_policy)2>'
warning: RTTI symbol not found for class 'std::_Sp_counted_ptr_inplace<mir::input::DefaultDevice, std::allocator<mir::input::DefaultDevice>, (__gnu_cxx::_Lock_policy)2>'

std::shared_ptr (count 3, weak 0) 0x7f08c8014f80)
    at /home/alan/display_server/mir/examples/server_example_input_device_config.cpp:187
#12 0x00007f08e0211136 in mir::input::DefaultInputDeviceHub::add_device_handle (this=0x2823fa0, handle=warning: RTTI symbol not found for class 'std::_Sp_counted_ptr_inplace<mir::input::DefaultDevice, std::allocator<mir::in...

Read more...

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

Cool. I had noticed some server threads hung/deadlocked there recently and not realised it was this bug.

Changed in mir:
status: Triaged → In Progress
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Bumped to High since Alan found it's a general deadlock in the server.

Changed in mir:
importance: Medium → High
summary: [regression] mir_demo_server refuses to quit on Ctrl+Alt+Backspace or
- Ctrl+C in its terminal
+ Ctrl+C in its terminal (deadlock in DefaultInputDeviceHub::add_device)
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 mir (Ubuntu):
status: New → Invalid
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (8.3 KiB)

This bug was fixed in the package mir - 0.27.0+17.10.20170630-0ubuntu1

---------------
mir (0.27.0+17.10.20170630-0ubuntu1) artful; urgency=medium

  [ Daniel van Vugt ]
  * New upstream release 0.27.0 (https://launchpad.net/mir/+milestone/0.27.0)
    - ABI summary:
      . mirclient ABI unchanged at 9
      . mirserver ABI bumped to 44
      . mircommon ABI unchanged at 7
      . mirplatform ABI bumped to 61
      . mirprotobuf ABI unchanged at 3
      . mirplatformgraphics ABI bumped to 13
      . mirclientplatform ABI unchanged at 5
      . mirinputplatform ABI bumped to 7
      . mircore ABI unchanged at 1
    - Enhancements:
      . Mostly groundwork required to support major enhancements coming in
        future Mir versions.
      . Removed android-input and eliminated the entire "3rd_party/" subtree.
        Now the Mir source tree contains original code only.
      . Added mir_prompt_session_new_fds_for_prompt_providers_sync API.
      . mirout: Added load and save options for keeping display configs
        on disk.
      . mirout: Added "--" support for applying configuration changes under
        Unity8.
      . Fixed failure of DRM hardware cursor {hide(); show(image);}
      . Added server option: "--cursor software" (MIR_SERVER_CURSOR=software)
      . Added letterboxing/black bars support to the GL renderer in preparation
        for generic output cloning.
      . Added client API for getting the logical size of an output.
      . Migrated MirCookie to use SHA-256.
      . Ensure RealKMSOutputConfiguration stays in sync with actual hardware
        state.
      . Added support for drag-and-drop.
      . Lots of other client API enhancements.
      . Minor clean-ups, optimizations and dead code removal.
      . Added support for building on Ubuntu 17.10 artful.
      . Update example code to use undeprecated API.
      . mesa-kms: Support hardware cursors in hybrid setups.
      . Rework and publish the graphics platform APIs
    - Bugs fixed:
      . [enhancement] Make able to get version information from client /
        server APIs (LP: #1195540)
      . Touch screen coordinates don't rotate with the screen (LP: #1349660)
      . Subpixel order not included in Mir display information (LP: #1393578)
      . [enhancement] Missing client API for relative surface movement (e.g.
        dragging client-decorated windows) (LP: #1420334) . Mir does not reset
        key states when paused or resumed (modifiers get stuck after VT
        switching) (LP: #1536279)
      . NBS never uses mc::MultiMonitorMode::single_monitor_fast, even when
        only a single monitor is plugged in (LP: #1561418)
      . Inconsistent behaviour of Num Lock (LP: #1588237)
      . A scaled (not panned or clipped) mirror/clone mode is desired
        (LP: #1639226)
      . Rotating an output left or right without restarting the
        compositor distorts the image (LP: #1643488)
      . support display scaling slider in unity8 (LP: #1645372)
      . [ FAILED ] NestedInputWithMouse.mouse_pointer_coordinates_in_nested_
        server_are_accumulated (LP: #1646375)
      . [ FAILED ] NestedInputWithMouse.mouse_pointer_position_is_in_sync_with_
        ho...

Read more...

Changed in mir (Ubuntu):
status: Invalid → 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.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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