Merge lp:~compiz-team/compiz/compiz.fix_1067964 into lp:compiz/0.9.9

Proposed by Sam Spilsbury
Status: Merged
Approved by: Daniel van Vugt
Approved revision: 3444
Merged at revision: 3441
Proposed branch: lp:~compiz-team/compiz/compiz.fix_1067964
Merge into: lp:compiz/0.9.9
Diff against target: 109 lines (+39/-14)
4 files modified
compizconfig/gsettings/CMakeLists.txt (+0/-6)
compizconfig/gsettings/gsettings_backend_shared/CMakeLists.txt (+2/-8)
compizconfig/libcompizconfig/src/main.c (+7/-0)
compizconfig/libcompizconfig/tests/compizconfig_test_ccs_object.cpp (+30/-0)
To merge this branch: bzr merge lp:~compiz-team/compiz/compiz.fix_1067964
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+131503@code.launchpad.net

Commit message

Don't link in static libraries that define their own objects twice, pull
them in through the shared library. Doing so will result in duplicate
static symbols for the type name and that always ends badly (LP: #1067964)

Description of the change

  Don't link in static libraries that define their own objects twice, pull
  them in through the shared library. Doing so will result in duplicate
  static symbols for the type name and that always ends badly (LP: #1067964)

To post a comment you must log in.
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

This may also fix bug 1067585

3442. By Sam Spilsbury

Added an error message about that

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

You don't need to use backslash to join lines. Strings in C and C++ always get joined:
    printf("Hello"
           " world");

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

This will crash:
  + ccsError ("Unable to find interface type %i on %p\n"\

No parameters provided for the %i or %p.

review: Needs Fixing
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Ah, thanks for the find, I was in a bit of a rush. Will fix.

3443. By Sam Spilsbury

Test the die behaviour and ensure no segfault

3444. By Sam Spilsbury

Memleak

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Fixed.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'compizconfig/gsettings/CMakeLists.txt'
2--- compizconfig/gsettings/CMakeLists.txt 2012-10-08 13:50:56 +0000
3+++ compizconfig/gsettings/CMakeLists.txt 2012-10-26 11:56:21 +0000
4@@ -25,12 +25,6 @@
5 ${CMAKE_SOURCE_DIR}/compizconfig/integration/gnome/include)
6
7 set (COMPIZCONFIG_GSETTINGS_BACKEND_LIBRARIES
8- compizconfig_gsettings_wrapper
9- compizconfig_gnome_integration
10- compizconfig_gnome_integration_gsettings_setting_factory
11- compizconfig_gnome_integration_gsettings_wrapper_factory
12- compizconfig_gsettings_wrapper_factory_interface
13- compizconfig_gsettings_wrapper_factory
14 compizconfig_gsettings_backend)
15
16 compizconfig_backend (gsettings PKGDEPS ${_deps} LIBRARIES ${COMPIZCONFIG_GSETTINGS_BACKEND_LIBRARIES})
17
18=== modified file 'compizconfig/gsettings/gsettings_backend_shared/CMakeLists.txt'
19--- compizconfig/gsettings/gsettings_backend_shared/CMakeLists.txt 2012-10-08 13:50:56 +0000
20+++ compizconfig/gsettings/gsettings_backend_shared/CMakeLists.txt 2012-10-26 11:56:21 +0000
21@@ -58,7 +58,9 @@
22 compizconfig_gsettings_util
23 compizconfig_gsettings_wrapper
24 compizconfig_gnome_integration
25+ compizconfig_gnome_integration_gsettings_integrated_setting
26 compizconfig_gnome_integration_gsettings_setting_factory
27+ compizconfig_gnome_integration_gsettings_wrapper_factory
28 compizconfig_gsettings_wrapper_factory_interface
29 compizconfig_gsettings_wrapper_factory
30 compizconfig)
31@@ -77,12 +79,4 @@
32 install (TARGETS compizconfig_gsettings_backend
33 DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
34
35- #
36- # Tell CMake that targets using compizconfig_gsettings_backend should NOT re-import the
37- # libraries that compizconfig_gsettings_backend depends on (contains).
38- #
39- set_target_properties (compizconfig_gsettings_backend PROPERTIES
40- LINK_INTERFACE_LIBRARIES ""
41- )
42-
43 endif (GSETTINGS_UTIL_FOUND)
44
45=== modified file 'compizconfig/libcompizconfig/src/main.c'
46--- compizconfig/libcompizconfig/src/main.c 2012-09-25 08:42:49 +0000
47+++ compizconfig/libcompizconfig/src/main.c 2012-10-26 11:56:21 +0000
48@@ -33,6 +33,7 @@
49 #include <dirent.h>
50 #include <math.h>
51 #include <errno.h>
52+#include <assert.h>
53
54 #include <ccs.h>
55
56@@ -182,6 +183,12 @@
57 return object->interfaces[i];
58 }
59
60+ ccsError ("Unable to find interface type %i on %p\n"
61+ "This is either a programmer error or more than one static library \n"
62+ "defining this interface has been linked in\n"
63+ "Unable to continue, please file a bug about this\n", interface_type, object);
64+ assert (0);
65+
66 return NULL;
67 }
68
69
70=== modified file 'compizconfig/libcompizconfig/tests/compizconfig_test_ccs_object.cpp'
71--- compizconfig/libcompizconfig/tests/compizconfig_test_ccs_object.cpp 2012-08-09 18:28:38 +0000
72+++ compizconfig/libcompizconfig/tests/compizconfig_test_ccs_object.cpp 2012-10-26 11:56:21 +0000
73@@ -98,6 +98,36 @@
74 free (to);
75 }
76
77+TEST(CCSObjectTest, GetInterface)
78+{
79+ TestingObjectWrapper *to = reinterpret_cast <TestingObjectWrapper *> (calloc (1, sizeof (TestingObjectWrapper)));
80+
81+ ccsObjectInit (to, &ccsDefaultObjectAllocator);
82+ ccsObjectAddInterface (to, reinterpret_cast <const CCSInterface *> (&SomeDummyInterface), CCS_INTERFACE_TYPE_DUMMY);
83+ DummyInterface *interface = GET_INTERFACE (DummyInterface, to);
84+
85+ EXPECT_EQ (interface, &SomeDummyInterface);
86+
87+ ccsObjectRemoveInterface (to, CCS_INTERFACE_TYPE_DUMMY);
88+
89+ free (to);
90+}
91+
92+TEST(CCSObjectDeathTest, GetInterface)
93+{
94+ TestingObjectWrapper *to = reinterpret_cast <TestingObjectWrapper *> (calloc (1, sizeof (TestingObjectWrapper)));
95+
96+ ccsObjectInit (to, &ccsDefaultObjectAllocator);
97+ ccsObjectAddInterface (to, reinterpret_cast <const CCSInterface *> (&SomeDummyInterface), CCS_INTERFACE_TYPE_DUMMY);
98+ ASSERT_DEATH ({
99+ GET_INTERFACE (Dummy2Interface, to);
100+ },
101+ "Unable to find interface type*");
102+
103+ ccsObjectRemoveInterface (to, CCS_INTERFACE_TYPE_DUMMY);
104+ free (to);
105+}
106+
107 TEST(CCSObjectTest, InterfaceRemove)
108 {
109 TestingObjectWrapper *to = (TestingObjectWrapper *) calloc (1, sizeof (TestingObjectWrapper));

Subscribers

People subscribed via source and target branches