office-gobmx/external/firebird/sanitizer.patch
Stephan Bergmann 7f15b7ae48 Full UBSan in external/firebird
...after 6a312a4a3d "Prepare external/firebird for
sanitizers".  Doing `make check screenshot` on Linux with Clang
-fsanitize=undefined -fsanitize=local-bounds -fsanitize=nullability works now.

Patches that might be unwanted in non-UBSan builds are added to sanitizer.patch
while unproblematic ones are added to always-included ubsan.patch.

CppunitTest_dbaccess_firebird_test, e.g., shows that
comphelper::AsyncEventNotifierAutoJoin::onTerminated called base-class
osl::Thread::onTerminated (which does nothing, anyway) of an already destroyed
object, so just drop that.

Change-Id: If50f442ee6dbe590db843c38681d1c1cade8fa6a
Reviewed-on: https://gerrit.libreoffice.org/47122
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-28 13:50:47 +01:00

80 lines
2.2 KiB
Diff

--- builds/posix/fbintl.vers
+++ builds/posix/fbintl.vers
@@ -29,3 +29,4 @@
LD_lookup_texttype
LD_setup_attributes
LD_version
+_ZTI*
--- builds/posix/fbplugin.vers
+++ builds/posix/fbplugin.vers
@@ -26,3 +26,4 @@
#
firebird_plugin
+_ZTI*
--- builds/posix/firebird.vers
+++ builds/posix/firebird.vers
@@ -367,3 +367,4 @@
KEYWORD_stringIsAToken
KEYWORD_getTokens
+_ZTI*
--- builds/posix/make.defaults
+++ builds/posix/make.defaults
@@ -252,7 +252,7 @@
# LINKER OPTIONS
#
-UNDEF_PLATFORM = -Wl,--no-undefined
+UNDEF_PLATFORM =
ifeq ($(TARGET),Debug)
UNDEF_FLAGS = $(UNDEF_PLATFORM)
endif
@@ -291,7 +291,7 @@
LIB_LINK_MAPFILE= -Wl,--version-script,$(1)
FIREBIRD_LIBRARY_LINK= -L$(LIB) -lfbclient $(MATHLIB)
-EXE_LINK_OPTIONS= $(LDFLAGS) $(THR_FLAGS) $(UNDEF_FLAGS) $(LIB_PATH_OPTS) $(LINK_EMPTY_SYMBOLS)
+EXE_LINK_OPTIONS= $(LDFLAGS) $(THR_FLAGS) $(UNDEF_FLAGS) $(LIB_PATH_OPTS)
LIB_LINK_OPTIONS= $(LDFLAGS) $(THR_FLAGS) -shared
FB_DAEMON = $(BIN)/firebird$(EXEC_EXT)
--- src/common/classes/alloc.cpp
+++ src/common/classes/alloc.cpp
@@ -2535,7 +2535,7 @@
const char* myStack = &probeVar;
const char* thisLocation = (const char*) this;
ptrdiff_t distance = thisLocation - myStack;
- fb_assert(absVal(distance) < 128 * 1024);
+ //fb_assert(absVal(distance) < 128 * 1024);
}
#endif
--- src/common/os/posix/mod_loader.cpp
+++ src/common/os/posix/mod_loader.cpp
@@ -88,7 +88,7 @@
ModuleLoader::Module* ModuleLoader::loadModule(const Firebird::PathName& modPath)
{
- void* module = dlopen(modPath.nullStr(), FB_RTLD_MODE);
+ void* module = dlopen(modPath.nullStr(), FB_RTLD_MODE | RTLD_GLOBAL);
if (module == NULL)
{
#ifdef DEV_BUILD
--- src/jrd/met.epp
+++ src/jrd/met.epp
@@ -1486,10 +1486,11 @@
USHORT offset = p[0] | (p[1] << 8);
p += 2;
- const Ods::Descriptor* odsDflDesc = (Ods::Descriptor*) p;
- p = (UCHAR*) (odsDflDesc + 1);
+ Ods::Descriptor odsDflDesc;
+ memcpy(&odsDflDesc, p, sizeof (Ods::Descriptor));
+ p = (UCHAR*) (((Ods::Descriptor*) p) + 1);
- dsc desc = *odsDflDesc;
+ dsc desc = odsDflDesc;
desc.dsc_address = const_cast<UCHAR*>(p);
EVL_make_value(tdbb, &desc, &format->fmt_defaults[offset], relation->rel_pool);