Mir

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

Proposed by Alan Griffiths
Status: Merged
Approved by: Kevin DuBois
Approved revision: no longer in the source branch.
Merged at revision: 1859
Proposed branch: lp:~alan-griffiths/mir/fix-1358698
Merge into: lp:mir
Prerequisite: lp:~alan-griffiths/mir/fix-cmake-inconsistency
Diff against target: 117 lines (+15/-10)
8 files modified
cmake/MirCommon.cmake (+8/-0)
debian/control (+2/-2)
debian/libmircommon1.install (+1/-1)
src/platform/graphics/android/CMakeLists.txt (+1/-3)
src/platform/graphics/mesa/CMakeLists.txt (+0/-1)
src/shared/CMakeLists.txt (+1/-1)
tests/integration-tests/CMakeLists.txt (+1/-1)
tests/unit-tests/CMakeLists.txt (+1/-1)
To merge this branch: bzr merge lp:~alan-griffiths/mir/fix-1358698
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Mir development team Pending
Review via email: mp+231423@code.launchpad.net

Commit message

Possible fix for lp:1358698

Description of the change

Possible fix for lp:1358698

I've still not been able to reproduce locally, so this fix is speculative.

If this does pass CI, then we ought to resubmit it a few times to ensure the fix is real.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Jenkins says no. The bug persists :(

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

I don't think "option optimize_for = LITE_RUNTIME;" is working, because we're not using protobuf-lite.

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

P.S. I already tried the alternate workaround of using libmirprotobuf.a statically. It doesn't work in libmircommon.so because libmirprotobuf.a's contents are not relocatable (-fPIC). You would have to link all executables to libmirprotobuf.a directly, if not rebuild protobuf yourself.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

What I think is happening is that when we dlopen("libmirplatformgraphics.so", ...) we *don't* load the libmirplatformgraphics.so platform from the build, but the one previously installed on the system.

Because we're using libmircommon.so.2 and the release libmirplatformgraphics.so has linked against libmircommon.so.1 we end up with two versions of mircommon registering with libprotobuf. Hence the error.

The current version of this MP should masks the problem by reverting the bump to libmircommon.so.2 - so we only get a single version loaded and CI works. It also removes some unnecessary linking against mircommon which (once that change is released) will reduce the likelihood of similar problems in the future.

The reason the problem started appearing was a combination of two factors:

1. prior to the latest release version it was an unversioned mirprotobuf that registered with libprotobuf, not a versioned mircommon
2. we (duflu thinks unnecessarily) bumped the mircommon version

As the latter landed before the former there was no CI error at that stage.

*This does not address the root cause*

The root cause is loading that we are dlopen()ing the incorrect libmirplatformgraphics.so - and I'm going to log that as a bug if this MP has the expected effect.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

It looks like the branch is to blame but I can't tell why...

/usr/lib/gcc-cross/arm-linux-gnueabihf/4.9/../../../../arm-linux-gnueabihf/bin/ld: cannot find -landroid-properties
collect2: error: ld returned 1 exit status
src/platform/graphics/android/CMakeFiles/mirplatformgraphicsandroid.dir/build.make:117: recipe for target 'lib/android/libmirplatformgraphics.so' failed
make[2]: *** [lib/android/libmirplatformgraphics.so] Error 1

Revision history for this message
Chris Halse Rogers (raof) wrote :

Oh! You know why it's looking in /usr/ for dlopen("libmirplatformgraphics.so")? Because CMake likes to set ALL THE RPATHS. This also means that I think we're not necessarily testing the right client code, too.

I think I know how to get CMake to be less rpath-happy, and see whether that resolves this...

Revision history for this message
Chris Halse Rogers (raof) wrote :

I'm confident that https://code.launchpad.net/~raof/mir/buildsystems-are-the-worst/+merge/231840 should fix the root cause of this for us; it fixes it on my N10 at least, on which I was able to reproduce the bug.

Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> It looks like the branch is to blame but I can't tell why...
>
> /usr/lib/gcc-cross/arm-linux-gnueabihf/4.9/../../../../arm-linux-
> gnueabihf/bin/ld: cannot find -landroid-properties
> collect2: error: ld returned 1 exit status
> src/platform/graphics/android/CMakeFiles/mirplatformgraphicsandroid.dir/build.
> make:117: recipe for target 'lib/android/libmirplatformgraphics.so' failed
> make[2]: *** [lib/android/libmirplatformgraphics.so] Error 1

Yes, the branch is to blame - my fault for not testing a clean build.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> [==========] Running 1 test from 1 test case.
> [----------] Global test environment set-up.
> [----------] 1 test from GLMark2Test
> [ RUN ] GLMark2Test.benchmark_fullscreen_default
>
> Segmentation fault (core dumped)
> + mir_rc=-1

WTF?

(At least this failure is a step forwards.)

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Kevin DuBois (kdub) wrote :

The performance test was disabled to unblock everything. No one could reproduce failure on device. retriggering, hopefully it works this time...

Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cmake/MirCommon.cmake'
2--- cmake/MirCommon.cmake 2014-04-15 05:31:19 +0000
3+++ cmake/MirCommon.cmake 2014-08-22 08:42:25 +0000
4@@ -54,6 +54,14 @@
5 ${EXECUTABLE_OUTPUT_PATH}/${EXECUTABLE} --gtest_list_tests > /dev/null
6 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
7 COMMENT "Check that discovering Tests in ${EXECUTABLE} works")
8+
9+ if (MIR_BUILD_PLATFORM_ANDROID)
10+ add_dependencies(${CHECK_TEST_DISCOVERY_TARGET_NAME} mirplatformgraphicsandroid)
11+ endif()
12+
13+ if (MIR_BUILD_PLATFORM_MESA)
14+ add_dependencies(${CHECK_TEST_DISCOVERY_TARGET_NAME} mirplatformgraphicsmesa)
15+ endif()
16
17 if (${ARGC} GREATER 1)
18 foreach (env ${ARGN})
19
20=== modified file 'debian/control'
21--- debian/control 2014-08-14 05:59:02 +0000
22+++ debian/control 2014-08-22 08:42:25 +0000
23@@ -108,7 +108,7 @@
24 Architecture: i386 amd64 armhf arm64
25 Multi-Arch: same
26 Pre-Depends: ${misc:Pre-Depends}
27-Depends: libmircommon2 (= ${binary:Version}),
28+Depends: libmircommon1 (= ${binary:Version}),
29 libprotobuf-dev (>= 2.4.1),
30 ${misc:Depends},
31 Breaks: mircommon-dev (<< 0.6)
32@@ -252,7 +252,7 @@
33 .
34 Contains a tool for stress testing the Mir display server
35
36-Package: libmircommon2
37+Package: libmircommon1
38 Section: libs
39 Architecture: i386 amd64 armhf arm64
40 Multi-Arch: same
41
42=== renamed file 'debian/libmircommon2.install' => 'debian/libmircommon1.install'
43--- debian/libmircommon2.install 2014-08-14 05:59:02 +0000
44+++ debian/libmircommon1.install 2014-08-22 08:42:25 +0000
45@@ -1,1 +1,1 @@
46-usr/lib/*/libmircommon.so.2
47+usr/lib/*/libmircommon.so.1
48
49=== modified file 'src/platform/graphics/android/CMakeLists.txt'
50--- src/platform/graphics/android/CMakeLists.txt 2014-08-04 08:58:40 +0000
51+++ src/platform/graphics/android/CMakeLists.txt 2014-08-22 08:42:25 +0000
52@@ -51,14 +51,12 @@
53 mirplatformgraphicsandroid
54
55 mirsharedandroid
56- mirplatform
57- mircommon
58
59 ${Boost_PROGRAM_OPTIONS_LIBRARY}
60 ${LIBHARDWARE_LIBRARIES}
61 ${EGL_LDFLAGS} ${EGL_LIBRARIES}
62 ${GLESv2_LDFLAGS} ${GLESv2_LIBRARIES}
63- ${ANDROID_PROPERTIES_LIBRARIES}
64+ ${ANDROID_PROPERTIES_LDFLAGS}
65 )
66
67 install(TARGETS mirplatformgraphicsandroid LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/mir/platformgraphics/android)
68
69=== modified file 'src/platform/graphics/mesa/CMakeLists.txt'
70--- src/platform/graphics/mesa/CMakeLists.txt 2014-08-04 08:58:40 +0000
71+++ src/platform/graphics/mesa/CMakeLists.txt 2014-08-22 08:42:25 +0000
72@@ -47,7 +47,6 @@
73 )
74
75 target_link_libraries(mirplatformgraphicsmesa
76- mirplatform
77
78 ${Boost_PROGRAM_OPTIONS_LIBRARY}
79 ${DRM_LDFLAGS} ${DRM_LIBRARIES}
80
81=== modified file 'src/shared/CMakeLists.txt'
82--- src/shared/CMakeLists.txt 2014-08-14 05:59:02 +0000
83+++ src/shared/CMakeLists.txt 2014-08-22 08:42:25 +0000
84@@ -40,7 +40,7 @@
85 )
86
87 # TODO we need a place to manage ABI and related versioning but use this as placeholder
88-set(MIRCOMMON_ABI 2)
89+set(MIRCOMMON_ABI 1)
90
91 set_target_properties(mircommon
92
93
94=== modified file 'tests/integration-tests/CMakeLists.txt'
95--- tests/integration-tests/CMakeLists.txt 2014-07-31 13:20:18 +0000
96+++ tests/integration-tests/CMakeLists.txt 2014-08-22 08:42:25 +0000
97@@ -74,7 +74,7 @@
98 if (MIR_TEST_PLATFORM STREQUAL "android")
99 target_link_libraries(mir_integration_tests
100 mirsharedandroid
101- ${ANDROID_PROPERTIES_LIBRARIES}
102+ ${ANDROID_PROPERTIES_LDFLAGS}
103 )
104 endif()
105
106
107=== modified file 'tests/unit-tests/CMakeLists.txt'
108--- tests/unit-tests/CMakeLists.txt 2014-08-15 13:42:19 +0000
109+++ tests/unit-tests/CMakeLists.txt 2014-08-22 08:42:25 +0000
110@@ -75,7 +75,7 @@
111 if (MIR_TEST_PLATFORM STREQUAL "android")
112 target_link_libraries(mir_unit_tests
113 mirsharedandroid
114- ${ANDROID_PROPERTIES_LIBRARIES}
115+ ${ANDROID_PROPERTIES_LDFLAGS}
116 )
117 endif()
118

Subscribers

People subscribed via source and target branches