Race between MirConnection::released() and MirConnection::~MirConnection() causes deadlocks, possible crashes and memory corruption
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mir |
Fix Released
|
Critical
|
Daniel van Vugt | ||
mir (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Race between MirConnection:
This is happening reliably only in one of my branches on krillin, where the thread calling released() is deadlocked trying to use internal locking primitives that another thread calling ~MirConnection is in the process of destructing.
It appears this is a known problem already judging by this comment:
MirConnection:
{
// We don't die while if are pending callbacks (as they touch this).
// But, if after 500ms we don't get a call, assume it won't happen.
connect_
std:
surface_
Although that code only waits for connections and doesn't bother to wait for releases which are the problem here.
Related branches
- Mir CI Bot: Approve (continuous-integration)
- Chris Halse Rogers: Approve
- Mir development team: Pending requested
-
Diff: 312 lines (+110/-11)11 files modifiedsrc/client/mir_connection.cpp (+8/-3)
src/client/rpc/mir_basic_rpc_channel.cpp (+23/-8)
src/client/rpc/mir_basic_rpc_channel.h (+8/-0)
src/client/rpc/mir_protobuf_rpc_channel.cpp (+24/-0)
src/client/rpc/mir_protobuf_rpc_channel.h (+3/-0)
tests/acceptance-tests/test_client_library.cpp (+14/-0)
tests/include/mir/test/doubles/stub_connection_configuration.h (+6/-0)
tests/unit-tests/client/test_client_mir_surface.cpp (+6/-0)
tests/unit-tests/client/test_mir_connection.cpp (+9/-0)
tests/unit-tests/client/test_mir_render_surface.cpp (+3/-0)
tests/unit-tests/platforms/android/client/test_android_client_platform.cpp (+6/-0)
Changed in mir: | |
milestone: | none → 0.26.0 |
Changed in mir: | |
assignee: | nobody → Daniel van Vugt (vanvugt) |
status: | New → In Progress |
Changed in mir: | |
status: | Fix Committed → Fix Released |
Fix committed into lp:mir at revision None, scheduled for release in mir, milestone 0.26.0