[Libreoffice-commits] core.git: 5 commits - external/cppunit external/icu leak-suppress.txt soltools/cpp

Stephan Bergmann sbergman at redhat.com
Thu May 22 05:33:56 PDT 2014


 external/cppunit/CPPUNIT_PLUGIN_EXPORT.patch.0 |   11 +++++++++++
 external/cppunit/UnpackedTarball_cppunit.mk    |    1 +
 external/icu/UnpackedTarball_icu.mk            |    1 +
 external/icu/icu-ubsan.patch.0                 |   20 ++++++++++++++++++++
 leak-suppress.txt                              |   14 +++++++++++++-
 soltools/cpp/_macro.c                          |    1 +
 soltools/cpp/_unix.c                           |    1 +
 7 files changed, 48 insertions(+), 1 deletion(-)

New commits:
commit 60c43d81ad4fa2ee587527d18522ac34148af2f2
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu May 22 14:33:00 2014 +0200

    Some trivial fix for hash function signed overflow undefined behavior
    
    Change-Id: I41ec24a02867ba3c5bf4f39b5d79bf6a3254ad0d

diff --git a/external/icu/UnpackedTarball_icu.mk b/external/icu/UnpackedTarball_icu.mk
index 77cd38a..3b06d22 100644
--- a/external/icu/UnpackedTarball_icu.mk
+++ b/external/icu/UnpackedTarball_icu.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,icu,\
 	external/icu/icu4c-mkdir.patch \
 	external/icu/icu4c-buffer-overflow.patch \
 	external/icu/icu4c-$(if $(filter ANDROID,$(OS)),android,rpath).patch \
+	external/icu/icu-ubsan.patch.0 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/icu/icu-ubsan.patch.0 b/external/icu/icu-ubsan.patch.0
new file mode 100644
index 0000000..ef3121f
--- /dev/null
+++ b/external/icu/icu-ubsan.patch.0
@@ -0,0 +1,20 @@
+--- source/common/ustring.cpp
++++ source/common/ustring.cpp
+@@ -1486,7 +1486,7 @@
+ */
+ 
+ #define STRING_HASH(TYPE, STR, STRLEN, DEREF) \
+-    int32_t hash = 0;                         \
++    uint32_t hash = 0;                         \
+     const TYPE *p = (const TYPE*) STR;        \
+     if (p != NULL) {                          \
+         int32_t len = (int32_t)(STRLEN);      \
+@@ -1497,7 +1497,7 @@
+             p += inc;                         \
+         }                                     \
+     }                                         \
+-    return hash
++    return static_cast<int32_t>(hash)
+ 
+ /* Used by UnicodeString to compute its hashcode - Not public API. */
+ U_CAPI int32_t U_EXPORT2
commit 77ad60af119ab23a0bfadb3e5a0c4433fe97835b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu May 22 14:28:20 2014 +0200

    Adapt CppUnit to our CPPUNIT_PLUGIN_EXPORT
    
    ...which mentions extern "C", so CppUnit's TestPlugInSignature must reflect
    that.  It is a bit odd how CPPUNIT_PLUGIN_EXPORT needs to be passed into
    CppUnit, so probably best to keep this as a local patch for now.  (Clang's
    -fsanitize=undefined complained about the mismatch.)
    
    Change-Id: Ied179a1afe82ceb04de4739c14cf8fadff31b80f

diff --git a/external/cppunit/CPPUNIT_PLUGIN_EXPORT.patch.0 b/external/cppunit/CPPUNIT_PLUGIN_EXPORT.patch.0
new file mode 100644
index 0000000..a764be9
--- /dev/null
+++ b/external/cppunit/CPPUNIT_PLUGIN_EXPORT.patch.0
@@ -0,0 +1,11 @@
+--- include/cppunit/plugin/TestPlugIn.h
++++ include/cppunit/plugin/TestPlugIn.h
+@@ -111,7 +111,7 @@
+ /*! \brief Type of the function exported by a plug-in.
+  * \ingroup WritingTestPlugIn
+  */
+-typedef CppUnitTestPlugIn *(*TestPlugInSignature)();
++extern "C" { typedef CppUnitTestPlugIn *(*TestPlugInSignature)(); }
+ 
+ 
+ /*! \brief Implements the function exported by the test plug-in
diff --git a/external/cppunit/UnpackedTarball_cppunit.mk b/external/cppunit/UnpackedTarball_cppunit.mk
index 86dc77d..a46e9bf 100644
--- a/external/cppunit/UnpackedTarball_cppunit.mk
+++ b/external/cppunit/UnpackedTarball_cppunit.mk
@@ -16,6 +16,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,cppunit,\
 	external/cppunit/windows.patch \
 	external/cppunit/unix.patch \
 	external/cppunit/wundef.patch \
+	external/cppunit/CPPUNIT_PLUGIN_EXPORT.patch.0 \
 ))
 ifeq ($(DISABLE_DYNLOADING),TRUE)
 $(eval $(call gb_UnpackedTarball_add_patches,cppunit,\
commit ec46bb9ff8d165ab7f4537e305f8d0dae707fcf8
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu May 22 14:26:57 2014 +0200

    Silence remaining memory leaks in soltools/cpp when run with lsan
    
    Change-Id: Ia71c9abedfd325b9f5bb2a5e28b2386db5c2fd6b

diff --git a/leak-suppress.txt b/leak-suppress.txt
index 3370a55..b9a1fd2 100644
--- a/leak-suppress.txt
+++ b/leak-suppress.txt
@@ -16,3 +16,6 @@ leak:cppu::defaultBootstrap_InitialComponentContext
 
 # global objects
 leak:SfxFilterContainer::ReadSingleFilter_Impl
+
+# build-time tool soltools/cpp:
+leak:soltools/cpp/_cpp.c
commit 0a181c9aa28f1e1315e31623c1f04e774d300ec3
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu May 22 14:24:26 2014 +0200

    Fix some memory leak in soltools/cpp tool
    
    ...though many more remain, as the design appears to be let heap grow
    until exit.
    
    Change-Id: I3e5cc95a0896c8add33a767209ab0ff60d6a4b52

diff --git a/soltools/cpp/_macro.c b/soltools/cpp/_macro.c
index bd91141..6d48ef6 100644
--- a/soltools/cpp/_macro.c
+++ b/soltools/cpp/_macro.c
@@ -133,6 +133,7 @@ void
 
         tap = normtokenrow(args);
         dofree(args->bp);
+        dofree(args);
         args = tap;
     }
     np->ap = args;
diff --git a/soltools/cpp/_unix.c b/soltools/cpp/_unix.c
index d1cd208..fa8abff 100644
--- a/soltools/cpp/_unix.c
+++ b/soltools/cpp/_unix.c
@@ -89,6 +89,7 @@ void
                 maketokenrow(3, &tr);
                 gettokens(&tr, 1);
                 doadefine(&tr, c);
+                dofree(tr.bp);
                 unsetsource();
                 break;
 
commit 916d3a8e1e35c042c69d13f650b57ed25a13063d
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu May 22 14:23:07 2014 +0200

    Clean up
    
    Change-Id: I1a651fb059e6cbaece53c8dbac7436b493f66cd5

diff --git a/leak-suppress.txt b/leak-suppress.txt
index 5e99d64..3370a55 100644
--- a/leak-suppress.txt
+++ b/leak-suppress.txt
@@ -1,5 +1,14 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
 
-#uno typelib
+# Use via environment variable LSAN_OPTIONS=.../leak-suppress.txt
+
+# uno typelib
 leak:cppu/source/typelib/typelib.cxx
 
 # uno component context


More information about the Libreoffice-commits mailing list