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
=== modified file 'tests/mir_test_framework/async_server_runner.cpp'
--- tests/mir_test_framework/async_server_runner.cpp 2017-09-18 10:57:00 +0000
+++ tests/mir_test_framework/async_server_runner.cpp 2017-10-31 18:01:05 +0000
@@ -78,6 +78,12 @@
78 env.emplace_back(key, value);78 env.emplace_back(key, value);
79}79}
8080
81namespace
82{
83// This avoids an intermittent shutdown crash deleting a stub-graphics buffer (LP: #1728931)
84std::shared_ptr<void> delay_unloading_graphics_platform;
85}
86
81void mtf::AsyncServerRunner::start_server()87void mtf::AsyncServerRunner::start_server()
82{88{
83 set_window_management_policy(server);89 set_window_management_policy(server);
@@ -100,6 +106,8 @@
100106
101 server.apply_settings();107 server.apply_settings();
102108
109 delay_unloading_graphics_platform = server.the_graphics_platform();
110
103 mt::AutoJoinThread t([&]111 mt::AutoJoinThread t([&]
104 {112 {
105 try113 try
@@ -143,7 +151,10 @@
143 server_thread.stop();151 server_thread.stop();
144}152}
145153
146mtf::AsyncServerRunner::~AsyncServerRunner() noexcept = default;154mtf::AsyncServerRunner::~AsyncServerRunner() noexcept
155{
156 delay_unloading_graphics_platform.reset();
157}
147158
148auto mtf::AsyncServerRunner::new_connection() -> std::string159auto mtf::AsyncServerRunner::new_connection() -> std::string
149{160{

Subscribers

People subscribed via source and target branches