Mir

Merge lp:~mir-team/mir/fix-1372276-0.7 into lp:mir/0.7

Proposed by Daniel van Vugt
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 1916
Proposed branch: lp:~mir-team/mir/fix-1372276-0.7
Merge into: lp:mir/0.7
Diff against target: 144 lines (+34/-2)
6 files modified
debian/changelog (+2/-0)
src/server/graphics/nested/nested_display.cpp (+2/-0)
src/server/graphics/nested/nested_display.h (+3/-0)
src/server/graphics/nested/nested_platform.cpp (+1/-1)
src/server/graphics/nested/nested_platform.h (+2/-1)
tests/unit-tests/graphics/nested/test_nested_display.cpp (+24/-0)
To merge this branch: bzr merge lp:~mir-team/mir/fix-1372276-0.7
Reviewer Review Type Date Requested Status
Cemil Azizoglu (community) Abstain
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+236458@code.launchpad.net

Commit message

nested: Ensure that the nested Platform object stays alive for at
least as long as the nested Display object needs it (LP: #1372276)

Description of the change

Backported from 0.8

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

0.7 is old news. We'll be releasing 0.8.0 to RTM and ubuntu soon. Unless, we have a train-wreck during testing. Abstaining for now, while 0.8 release is pending.

review: Abstain
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Well, 0.7 is still useful for maintaining RTM series'. And we're free to (and conventionally should do) upstream releases without/before any Ubuntu release.

Ubuntu can take it or leave it. Doesn't really matter.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-09-26 06:43:04 +0000
3+++ debian/changelog 2014-09-30 08:16:00 +0000
4@@ -4,6 +4,8 @@
5 - Bug fixes
6 . Fix jerky/stuttering event delivery that could happen inside
7 nested servers sometimes (LP: #1372300)
8+ . Nested server crashes with SIGSEGV on shutdown in eglDestroyContext()
9+ (LP: #1372276)
10 - Enhancement
11 . Reduced touch input lag slightly for 60Hz displays.
12
13
14=== modified file 'src/server/graphics/nested/nested_display.cpp'
15--- src/server/graphics/nested/nested_display.cpp 2014-07-09 07:54:29 +0000
16+++ src/server/graphics/nested/nested_display.cpp 2014-09-30 08:16:00 +0000
17@@ -120,11 +120,13 @@
18 }
19
20 mgn::NestedDisplay::NestedDisplay(
21+ std::shared_ptr<mg::Platform> const& platform,
22 std::shared_ptr<HostConnection> const& connection,
23 std::shared_ptr<input::InputDispatcher> const& dispatcher,
24 std::shared_ptr<mg::DisplayReport> const& display_report,
25 std::shared_ptr<mg::DisplayConfigurationPolicy> const& initial_conf_policy,
26 std::shared_ptr<mg::GLConfig> const& gl_config) :
27+ platform{platform},
28 connection{connection},
29 dispatcher{dispatcher},
30 display_report{display_report},
31
32=== modified file 'src/server/graphics/nested/nested_display.h'
33--- src/server/graphics/nested/nested_display.h 2014-06-02 17:07:02 +0000
34+++ src/server/graphics/nested/nested_display.h 2014-09-30 08:16:00 +0000
35@@ -44,6 +44,7 @@
36 class DisplayBuffer;
37 class DisplayConfigurationPolicy;
38 class GLConfig;
39+class Platform;
40
41 namespace nested
42 {
43@@ -95,6 +96,7 @@
44 {
45 public:
46 NestedDisplay(
47+ std::shared_ptr<Platform> const& platform,
48 std::shared_ptr<HostConnection> const& connection,
49 std::shared_ptr<input::InputDispatcher> const& dispatcher,
50 std::shared_ptr<DisplayReport> const& display_report,
51@@ -124,6 +126,7 @@
52 std::unique_ptr<graphics::GLContext> create_gl_context() override;
53
54 private:
55+ std::shared_ptr<Platform> const platform;
56 std::shared_ptr<HostConnection> const connection;
57 std::shared_ptr<input::InputDispatcher> const dispatcher;
58 std::shared_ptr<DisplayReport> const display_report;
59
60=== modified file 'src/server/graphics/nested/nested_platform.cpp'
61--- src/server/graphics/nested/nested_platform.cpp 2014-06-16 23:37:57 +0000
62+++ src/server/graphics/nested/nested_platform.cpp 2014-09-30 08:16:00 +0000
63@@ -86,7 +86,7 @@
64 std::shared_ptr<mg::GLConfig> const& gl_config)
65 {
66 return std::make_shared<mgn::NestedDisplay>(
67- connection, dispatcher, display_report, conf_policy, gl_config);
68+ shared_from_this(), connection, dispatcher, display_report, conf_policy, gl_config);
69 }
70
71 std::shared_ptr<mg::PlatformIPCPackage> mgn::NestedPlatform::get_ipc_package()
72
73=== modified file 'src/server/graphics/nested/nested_platform.h'
74--- src/server/graphics/nested/nested_platform.h 2014-06-16 23:37:57 +0000
75+++ src/server/graphics/nested/nested_platform.h 2014-09-30 08:16:00 +0000
76@@ -31,7 +31,8 @@
77 namespace nested
78 {
79
80-class NestedPlatform : public Platform
81+class NestedPlatform : public Platform,
82+ public std::enable_shared_from_this<NestedPlatform>
83 {
84 public:
85 NestedPlatform(
86
87=== modified file 'tests/unit-tests/graphics/nested/test_nested_display.cpp'
88--- tests/unit-tests/graphics/nested/test_nested_display.cpp 2014-05-20 03:37:18 +0000
89+++ tests/unit-tests/graphics/nested/test_nested_display.cpp 2014-09-30 08:16:00 +0000
90@@ -27,6 +27,7 @@
91 #include "mir_test_doubles/mock_gl_config.h"
92 #include "mir_test_doubles/stub_gl_config.h"
93 #include "mir_test_doubles/stub_host_connection.h"
94+#include "mir_test_doubles/null_platform.h"
95 #include "mir_test/fake_shared.h"
96
97 #include <gtest/gtest.h>
98@@ -63,6 +64,8 @@
99 mir::report::null::DisplayReport null_display_report;
100 mg::DefaultDisplayConfigurationPolicy default_conf_policy;
101 mtd::StubGLConfig stub_gl_config;
102+ std::shared_ptr<mtd::NullPlatform> null_platform{
103+ std::make_shared<mtd::NullPlatform>()};
104 };
105
106 }
107@@ -94,6 +97,7 @@
108 Return(EGL_TRUE)));
109
110 mgn::NestedDisplay nested_display{
111+ null_platform,
112 std::make_shared<SingleDisplayHostConnection>(),
113 mt::fake_shared(null_input_dispatcher),
114 mt::fake_shared(null_display_report),
115@@ -111,9 +115,29 @@
116 .Times(0);
117
118 mgn::NestedDisplay nested_display{
119+ null_platform,
120 mt::fake_shared(host_connection),
121 mt::fake_shared(null_input_dispatcher),
122 mt::fake_shared(null_display_report),
123 mt::fake_shared(default_conf_policy),
124 mt::fake_shared(stub_gl_config)};
125 }
126+
127+// Regression test for LP: #1372276
128+TEST_F(NestedDisplay, keeps_platform_alive)
129+{
130+ using namespace testing;
131+
132+ mgn::NestedDisplay nested_display{
133+ null_platform,
134+ std::make_shared<SingleDisplayHostConnection>(),
135+ mt::fake_shared(null_input_dispatcher),
136+ mt::fake_shared(null_display_report),
137+ mt::fake_shared(default_conf_policy),
138+ mt::fake_shared(stub_gl_config)};
139+
140+ std::weak_ptr<mtd::NullPlatform> weak_platform = null_platform;
141+ null_platform.reset();
142+
143+ EXPECT_FALSE(weak_platform.expired());
144+}

Subscribers

People subscribed via source and target branches

to all changes: