summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-11-24 08:22:51 +0100
committerTor Lillqvist <tml@iki.fi>2020-12-13 17:23:32 +0200
commit12464a04ae5090402ec3e88763ff65075c7ae96d (patch)
tree4bec696f69778ee6d6c7c5a390e0fb1ac0787767
parent70c79929dd2fd851aedcf162284cb495db277a83 (diff)
New UBSan failures with Firebird 3.0.7
While building ExternalProject_firebird: For one, the ICU UCHAR_TYPE mismatch > workdir/UnpackedTarball/firebird/src/intl/cs_icu.cpp:66:30: runtime error: call to function ucnv_fromUChars_68 through pointer to incorrect function type 'int (*)(UConverter *, char *, int, const unsigned short *, int, UErrorCode *)' from 61411db9f719d793f0665a4d278e0748e8fcd75f "external/firebird: ICU_UCHAR_TYPE breaks -fsanitize=function" returned in a slightly different form. Instead of passing in the problematic UCHAR_TYPE macro from external/firebird/ExternalProject_firebird.mk, Firebird now set it internally in src/common/common.h. And for another, it grew a new invalid-shift-base at > workdir/UnpackedTarball/firebird/src/yvalve/gds.cpp:2564:33: runtime error: left shift of negative value -1 (And beyond that there were no further new ASan/UBSan issues with a full `make check screenshot`.) Change-Id: Ie15cf6bde2df7dc784fec89045026f71747aa0bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106477 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--external/firebird/ubsan.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/external/firebird/ubsan.patch b/external/firebird/ubsan.patch
index cd71997f0ba6..fa296108d3d6 100644
--- a/external/firebird/ubsan.patch
+++ b/external/firebird/ubsan.patch
@@ -86,6 +86,15 @@
return *this;
}
StringType& assign(const_pointer s)
+--- src/common/common.h
++++ src/common/common.h
+@@ -1002,6 +1002,5 @@
+ }
+
+ #undef UCHAR_TYPE
+-#define UCHAR_TYPE uint16_t
+
+ #endif /* COMMON_COMMON_H */
--- src/common/unicode_util.cpp
+++ src/common/unicode_util.cpp
@@ -187,7 +187,7 @@
@@ -285,3 +294,14 @@
SRQ_PTR enqueue(thread_db*, Firebird::CheckStatusWrapper*, SRQ_PTR, const USHORT,
const UCHAR*, const USHORT, UCHAR, lock_ast_t, void*, SINT64, SSHORT, SRQ_PTR);
+--- src/yvalve/gds.cpp
++++ src/yvalve/gds.cpp
+@@ -2561,7 +2561,7 @@
+ value += ((SLONG) *ptr++) << shift;
+ shift += 8;
+ }
+- value += ((SLONG)(SCHAR) *ptr) << shift;
++ value += ((ULONG)(SCHAR) *ptr) << shift;
+
+ return value;
+ }