Mir

MultiThreadedCompositor deadlocks

Bug #1335311 reported by Alberto Aguirre
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mir
Fix Released
High
Alberto Aguirre
0.4
Fix Released
High
Alberto Aguirre
mir (Ubuntu)
Fix Released
High
Unassigned

Bug Description

The easiest way to reproduce is to use double buffering - src/server/compositor/buffer_stream_factory.cpp:

auto switching_bundle = std::make_shared<mc::BufferQueue>(3, gralloc, buffer_properties, *policy_factory);

auto switching_bundle = std::make_shared<mc::BufferQueue>(2, gralloc, buffer_properties, *policy_factory);

Then:

mir_demo_server_shell --display-config=sidebyside
mir_demo_client_egltriangle -n

In the shell: ALT+Ctrl+<arrow keys> to change orientation which will restart the compositor.

It's a race between 3 threads:

Thread A owns SceneObserver::mutex, responding to a frame_posted notification, waiting to acquire CompositingFunctor::run_mutex (MultiThreadedCompositor::schedule_compositing)

Thread B owns CompositingFunctor::run_mutex and it's waiting to acquire RenderingTracker::guard (due to display_buffer_compositor_factory->create_compositor_for(buffer);)

Thread C executing display_buffer_compositor->composite(), owns RenderingTracker::guard and its waiting to acquire SceneObserver::mutex

Related branches

Revision history for this message
Alberto Aguirre (albaguirre) wrote :
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Also see duplicate bug 1335735, for a manifestation of this bug in the tests.

Changed in mir:
status: New → In Progress
Changed in mir:
status: In Progress → Fix Committed
Changed in mir:
milestone: 0.4.0 → 0.5.0
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Fix backported to the 0.4 series at:
------------------------------------------------------------
revno: 1735
committer: Cemil Azizoglu <email address hidden>
branch nick: mir-0.4.0
timestamp: Tue 2014-07-01 18:50:01 +0300
message:
  Merge r1737 and r1738 from devel.
------------------------------------------------------------

Changed in mir:
milestone: 0.5.0 → none
status: Fix Committed → Fix Released
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

mir (0.4.0+14.10.20140701.1-0ubuntu1) utopic; urgency=medium

Changed in mir (Ubuntu):
importance: Undecided → High
status: New → Fix Released
Changed in mir:
milestone: none → 0.5.0
status: Fix Released → Fix Committed
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.