[regression] titlebar in "canonical" example WM + KeyRepeatDispatcher causes deadlock
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mir |
Fix Released
|
High
|
Alan Griffiths | ||
mir (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Introducing the KeyRepeatDispatcher means that input events can now occur on two threads: the "Input dispatch" thread and the GLibMainLoop thread. This leads to lock contention in EventFilterChai
What is fatal is that this breaks the (dubious) assumption in CanonicalWindow
Original text:
I caused this while testing a branch (lp:~alan-griffiths/mir/msh_SystemCompositorWindowManager), but I don't think the problem originates there:
$ sudo bin/mir_demo_server --file /tmp/mir_socket --vt 2 --arw-file --window-manager system-compositor
$ bin/mir_demo_server --host /tmp/mir_socket --window-manager canonical
$ bin/mir_
After a few Alt+Tab focus switches things lock up in the nested server. Attaching with GDB gets the following stack traces:
The event loop (via) KeyRepeatDispatcher is waiting for a lock in EventFilterChai
#0 __lll_lock_wait () at ../sysdeps/
#1 0x00007ffff6960cfd in __GI___
#2 0x00007ffff76e7815 in __gthread_
at /usr/include/
#3 0x00007ffff76e8738 in std::mutex::lock (this=0x7ca060) at /usr/include/
#4 0x00007ffff76e8b2e in std::lock_
at /usr/include/
#5 0x00007ffff775d1db in mir::input:
at /home/alan/
#6 0x00007ffff775d510 in mir::input:
at /home/alan/
#7 0x00007ffff7796e2e in mir::input:
at /home/alan/
#8 0x00007ffff7797512 in std::_Function_
#9 0x00007ffff76ee54c in std::function<void ()>::operator()() const (this=0x7fffe00
at /usr/include/
#10 0x00007ffff773b626 in mir::BasicCallb
at /home/alan/
#11 0x00007ffff773b111 in mir::LockableCa
at /home/alan/
#12 0x00007ffff770face in mir::detail:
at /home/alan/
#13 0x00007ffff5443c3d in g_main_
#14 0x00007ffff5443f20 in ?? () from /lib/x86_
#15 0x00007ffff5443fcc in g_main_
#16 0x00007ffff7705f91 in mir::GLibMainLo
---Type <return> to continue, or q <return> to quit---
The lock is held by the window manager (which is trying to paint a titlebar).
#0 pthread_
#1 0x00007ffff64f7d1c in std::condition_
from /usr/lib/
#2 0x00000000004b270b in std::condition_
this=
#3 0x00000000004aeaa4 in (anonymous namespace)
surface_
at /home/alan/
#4 0x00000000004aecea in (anonymous namespace)
titlebar_
#5 0x00000000004b0f45 in mir::examples:
surface=
at /home/alan/
#6 0x00000000004b042a in mir::examples:
event=
#7 0x00000000004a0c5e in mir::examples:
at /home/alan/
#8 0x00007ffff78beccb in mir::shell:
at /home/alan/
#9 0x00007ffff775d27c in mir::input:
at /home/alan/
#10 0x00007ffff775d510 in mir::input:
at /home/alan/
#11 0x00007ffff7796d22 in mir::input:
at /home/alan/
---Type <return> to continue, or q <return> to quit---
I guess the titlebar paint doesn't complete because the event loop is waiting.
Related branches
- Kevin DuBois (community): Approve
- Alberto Aguirre (community): Approve
- PS Jenkins bot (community): Approve (continuous-integration)
-
Diff: 140 lines (+39/-45)2 files modifiedexamples/server_example_canonical_window_manager.cpp (+23/-44)
examples/server_example_canonical_window_manager.h (+16/-1)
Changed in mir: | |
status: | New → In Progress |
assignee: | nobody → Alan Griffiths (alan-griffiths) |
description: | updated |
Changed in mir: | |
milestone: | none → 0.14.0 |
importance: | Undecided → High |
summary: |
- titlebar in "canonical" example WM + KeyRepeatDispatcher causes deadlock + [regression] titlebar in "canonical" example WM + KeyRepeatDispatcher + causes deadlock |
tags: | added: regression |
Changed in mir: | |
status: | Fix Committed → Fix Released |
Yep, the host server isn't needed above. Replace the two servers above with:
$ sudo bin/mir_demo_server --vt 2 --window-manager canonical --arw-file --file= /run/user/ 1000/mir_ socket