Mir

Merge lp:~alan-griffiths/mir/fix-1728931 into lp:mir

Proposed by Alan Griffiths
Status: Rejected
Rejected by: Michał Sawicz
Proposed branch: lp:~alan-griffiths/mir/fix-1728931
Merge into: lp:mir
Diff against target: 37 lines (+12/-1)
1 file modified
tests/mir_test_framework/async_server_runner.cpp (+12/-1)
To merge this branch: bzr merge lp:~alan-griffiths/mir/fix-1728931
Reviewer Review Type Date Requested Status
Michał Sawicz Needs Resubmitting
Review via email: mp+333044@code.launchpad.net

Commit message

Prevent the (stub-graphics) module being unloaded while a test is using it. (LP: #1728931)

Description of the change

Prevent the (stub-graphics) module being unloaded while a test is using it.

I'm suspicious that same issue (of potentially using/deleting buffers allocated by a graphics platform after the platform unloads) exists more generally, but this fixes the only known case.

To post a comment you must log in.
Revision history for this message
Michał Sawicz (saviq) wrote :
review: Needs Resubmitting

Unmerged revisions

4306. By Alan Griffiths

Prevent the graphics platform unloading before the test finishes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/mir_test_framework/async_server_runner.cpp'
2--- tests/mir_test_framework/async_server_runner.cpp 2017-09-18 10:57:00 +0000
3+++ tests/mir_test_framework/async_server_runner.cpp 2017-10-31 18:01:05 +0000
4@@ -78,6 +78,12 @@
5 env.emplace_back(key, value);
6 }
7
8+namespace
9+{
10+// This avoids an intermittent shutdown crash deleting a stub-graphics buffer (LP: #1728931)
11+std::shared_ptr<void> delay_unloading_graphics_platform;
12+}
13+
14 void mtf::AsyncServerRunner::start_server()
15 {
16 set_window_management_policy(server);
17@@ -100,6 +106,8 @@
18
19 server.apply_settings();
20
21+ delay_unloading_graphics_platform = server.the_graphics_platform();
22+
23 mt::AutoJoinThread t([&]
24 {
25 try
26@@ -143,7 +151,10 @@
27 server_thread.stop();
28 }
29
30-mtf::AsyncServerRunner::~AsyncServerRunner() noexcept = default;
31+mtf::AsyncServerRunner::~AsyncServerRunner() noexcept
32+{
33+ delay_unloading_graphics_platform.reset();
34+}
35
36 auto mtf::AsyncServerRunner::new_connection() -> std::string
37 {

Subscribers

People subscribed via source and target branches