Intermittent deadlock when swithcing to session with custom display configuration while closing other session
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mir |
Fix Released
|
High
|
Alexandros Frantzis | ||
0.4 |
Won't Fix
|
Undecided
|
Unassigned | ||
mir (Ubuntu) |
Fix Released
|
High
|
Unassigned |
Bug Description
If when closing a session we change focus to another session that has a custom display configuration, we may hit a deadlock.
This can been seen occasionally as a hang when logging out of an X session under XMir. It currently only affects XMir because it is the only production client that applies custom display configurations.
Here is how it happens:
[IPC thread]
~SessionMediator
SessionManager:
SessionManager:
BroadcastingSes
MediatingDispla
From this point we have two interesting execution threads:
[IPC thread continues]
~ApplicationSession
...
mir::scene:
...
AsioMainLoop:
[MainLoop thread]
Executes display reconfiguration action:
MultiThreadedCo
mir::scene:
If the IPC thread calls the surface_removed() observer before the display reconfiguration action is executed, then the MainLoop thread at [2] ends up waiting for a WRITE lock, but can't get it because a READ lock has been acquired at [1]. At the same time, the IPC thread is blocked waiting for unregister_
Related branches
- PS Jenkins bot (community): Approve (continuous-integration)
- Alan Griffiths: Approve
-
Diff: 259 lines (+205/-3)5 files modifiedinclude/shared/mir/basic_observers.h (+7/-3)
tests/acceptance-tests/CMakeLists.txt (+1/-0)
tests/acceptance-tests/test_client_with_custom_display_config_deadlock.cpp (+72/-0)
tests/unit-tests/CMakeLists.txt (+1/-0)
tests/unit-tests/test_basic_observers.cpp (+124/-0)
tags: | added: rtm14 |
Changed in mir: | |
milestone: | none → 0.5.0 |
Changed in mir (Ubuntu): | |
importance: | Undecided → High |
status: | New → Triaged |
Changed in mir: | |
status: | Fix Committed → Fix Released |
Fix committed into lp:mir/devel at revision None, scheduled for release in mir, milestone Unknown