[Libreoffice-commits] online.git: test/Makefile.am

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Fri Jan 24 09:34:18 UTC 2020


 test/Makefile.am |   31 +++++++++++++++++--------------
 1 file changed, 17 insertions(+), 14 deletions(-)

New commits:
commit ea9c80b588041f2b19045fe4d7b300c6c2e4338d
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Fri Jan 24 08:48:14 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Jan 24 10:34:00 2020 +0100

    test: fix ODR-violation in SigUtil
    
    ==6642==ERROR: AddressSanitizer: odr-violation (0x0000024db3a0):
      [1] size=4 'SigUtil::SigHandlerTrap::SigHandling' ../common/SigUtil.cpp:113:38
      [2] size=4 'SigUtil::SigHandlerTrap::SigHandling' common/SigUtil.cpp:113:38
    These globals were registered at these points:
      [1]:
        #0 0x68d7d8 in __asan_register_globals.part.13 lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
        #1 0x7f4b7eeed83b in asan.module_ctor (online-san/test/../test/.libs/unit-base.so+0x6fd83b)
    
      [2]:
        #0 0x68d7d8 in __asan_register_globals.part.13 lode/packages/llvm-472c6ef8b0f53061b049039f9775ab127beafbe4.src/compiler-rt/lib/asan/asan_globals.cc:365
        #1 0x104590e in asan.module_ctor (online-san/loolwsd+0x104590e)
    
    No need to include SigUtil for unit-base (invoked during 'make check'),
    it's only needed for unittest_SOURCES (invoked during 'make').
    
    Same for Log::IsShutdown(), 'vtable for Session', 'typeinfo name for
    TileQueue', 'JWTAuth::_key', 'vtable for ClientSession',
    'UnitBase::Global', 'SocketPoll::DefaultPollTimeoutMs' and
    'SslContext::Instance'.
    
    But don't just remove all wsd_sources from the new-style unit tests, as
    that would lead to missing symbols:
    
    [ loolwsd ] ERR  Failed to load online-san/test/../test/.libs/unit-base.so: online-san/test/../test/.libs/unit-base.so: undefined symbol: _Z20documentViewCallbackiPKcPv| common/Unit.cpp:40
    
    (Seen during make check's unit-base.)
    
    Change-Id: I305185f6437c5b4887d8e09a592e578a94f2659c
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87323
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/test/Makefile.am b/test/Makefile.am
index 7f15ef069..a6c12aff9 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -54,26 +54,14 @@ AM_CPPFLAGS = -pthread -I$(top_srcdir) -DBUILDING_TESTS
 
 wsd_sources = \
             ../common/FileUtil.cpp \
-            ../common/SigUtil.cpp \
             ../common/IoUtil.cpp \
-            ../common/Log.cpp \
             ../common/Protocol.cpp \
-            ../common/Session.cpp \
             ../common/SpookyV2.cpp \
             ../common/Util.cpp \
-            ../common/MessageQueue.cpp \
             ../common/Authorization.cpp \
             ../kit/Kit.cpp \
             ../kit/TestStubs.cpp \
-            ../wsd/Auth.cpp \
-            ../wsd/TileCache.cpp \
-            ../wsd/TestStubs.cpp \
-            ../common/Unit.cpp \
-            ../net/Socket.cpp
-
-if ENABLE_SSL
-wsd_sources += ../net/Ssl.cpp
-endif
+            ../wsd/TileCache.cpp
 
 test_base_source = \
 	TileQueueTests.cpp \
@@ -82,7 +70,22 @@ test_base_source = \
 	$(wsd_sources)
 
 unittest_CPPFLAGS = -I$(top_srcdir) -DBUILDING_TESTS -DSTANDALONE_CPPUNIT
-unittest_SOURCES = $(test_base_source) test.cpp
+unittest_SOURCES = \
+    $(test_base_source) \
+    ../common/Log.cpp \
+    ../common/MessageQueue.cpp \
+    ../common/Session.cpp \
+    ../common/SigUtil.cpp \
+    ../common/Unit.cpp \
+    ../net/Socket.cpp \
+    ../wsd/Auth.cpp \
+    ../wsd/TestStubs.cpp \
+    test.cpp
+
+if ENABLE_SSL
+unittest_SOURCES += ../net/Ssl.cpp
+endif
+
 unittest_LDADD = $(CPPUNIT_LIBS)
 
 fakesockettest_SOURCES = fakesockettest.cpp ../net/FakeSocket.cpp


More information about the Libreoffice-commits mailing list