summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-04-11 08:50:49 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-04-11 11:40:34 +0200
commit7bd520428bf594d5edd217e58c8762f8d3648d04 (patch)
treeea9b5b85637d96c143c9f2264828cca07254dd29 /external
parentca04e146ba4581f63bc9548ef926b611f1578804 (diff)
external/firebird: Avoid -fsanitize=nonnull-attribute
...that hits at least during the build of firebird with also ASan enabled (support for which will be committed shortly): > [...]/workdir/UnpackedTarball/firebird/gen/Debug/firebird/bin/isql -q -i [...]/workdir/UnpackedTarball/firebird/src/dbs/metadata.sql > workdir/UnpackedTarball/firebird/src/jrd/btr.cpp:5394:19: runtime error: null pointer passed as argument 2, which is declared to never be null > /usr/include/string.h:43:28: note: nonnull attribute specified here > #0 in insert_node(Jrd::thread_db*, Jrd::win*, Jrd::index_insertion*, Jrd::temporary_key*, RecordNumber*, unsigned int*, unsigned int*) at workdir/UnpackedTarball/firebird/src/jrd/btr.cpp:5394:2 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/plugins/libEngine12.so +0x1ae2914) > #1 in add_node(Jrd::thread_db*, Jrd::win*, Jrd::index_insertion*, Jrd::temporary_key*, RecordNumber*, unsigned int*, unsigned int*) at workdir/UnpackedTarball/firebird/src/jrd/btr.cpp:2279:24 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/plugins/libEngine12.so +0x1ac5a92) > #2 in BTR_insert(Jrd::thread_db*, Jrd::win*, Jrd::index_insertion*) at workdir/UnpackedTarball/firebird/src/jrd/btr.cpp:1008:21 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/plugins/libEngine12.so +0x1ac29b5) > #3 in insert_key(Jrd::thread_db*, Jrd::jrd_rel*, Jrd::Record*, Jrd::jrd_tra*, Jrd::win*, Jrd::index_insertion*, Jrd::IndexErrorContext&) at workdir/UnpackedTarball/firebird/src/jrd/idx.cpp:1475:2 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/plugins/libEngine12.so +0x1c62e01) > #4 in IDX_store(Jrd::thread_db*, Jrd::record_param*, Jrd::jrd_tra*) at workdir/UnpackedTarball/firebird/src/jrd/idx.cpp:1018:22 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/plugins/libEngine12.so +0x1c661a2) > #5 in Jrd::StoreNode::store(Jrd::thread_db*, Jrd::jrd_req*, Jrd::StmtNode::WhichTrigger) const at workdir/UnpackedTarball/firebird/src/dsql/StmtNodes.cpp:7005:5 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/plugins/libEngine12.so +0x21c0c96) > #6 in Jrd::StoreNode::execute(Jrd::thread_db*, Jrd::jrd_req*, Jrd::StmtNode::ExeState*) const at workdir/UnpackedTarball/firebird/src/dsql/StmtNodes.cpp:6942:13 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/plugins/libEngine12.so +0x21bf955) > #7 in EXE_looper(Jrd::thread_db*, Jrd::jrd_req*, Jrd::StmtNode const*) at workdir/UnpackedTarball/firebird/src/jrd/exe.cpp:1292:17 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/plugins/libEngine12.so +0x157f798) > #8 in looper_seh(Jrd::thread_db*, Jrd::jrd_req*, Jrd::StmtNode const*) at workdir/UnpackedTarball/firebird/src/jrd/exe.cpp:1426:2 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/plugins/libEngine12.so +0x15834fc) > #9 in execute_looper(Jrd::thread_db*, Jrd::jrd_req*, Jrd::jrd_tra*, Jrd::StmtNode const*, Jrd::jrd_req::req_s) at workdir/UnpackedTarball/firebird/src/jrd/exe.cpp:1023:2 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/plugins/libEngine12.so +0x15740c3) > #10 in EXE_send(Jrd::thread_db*, Jrd::jrd_req*, unsigned short, unsigned int, unsigned char const*) at workdir/UnpackedTarball/firebird/src/jrd/exe.cpp:833:2 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/plugins/libEngine12.so +0x1579392) > #11 in add_index_set(Jrd::thread_db*) at workdir/UnpackedTarball/firebird/temp/Debug/jrd/ini.cpp:2251:3 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/plugins/libEngine12.so +0x1efb0c2) > #12 in INI_format(char const*, char const*) at workdir/UnpackedTarball/firebird/temp/Debug/jrd/ini.cpp:1563:2 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/plugins/libEngine12.so +0x1eef3bd) > #13 in Jrd::JProvider::createDatabase(Firebird::CheckStatusWrapper*, char const*, unsigned int, unsigned char const*) at workdir/UnpackedTarball/firebird/src/jrd/jrd.cpp:2691:4 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/plugins/libEngine12.so +0x1864267) > #14 in Firebird::IProviderBaseImpl<Jrd::JProvider, Firebird::CheckStatusWrapper, Firebird::IPluginBaseImpl<Jrd::JProvider, Firebird::CheckStatusWrapper, Firebird::Inherit<Firebird::IReferenceCountedImpl<Jrd::JProvider, Firebird::CheckStatusWrapper, Firebird::Inherit<Firebird::IVersionedImpl<Jrd::JProvider, Firebird::CheckStatusWrapper, Firebird::Inherit<Firebird::IProvider> > > > > > >::cloopcreateDatabaseDispatcher(Firebird::IProvider*, Firebird::IStatus*, char const*, unsigned int, unsigned char const*) at workdir/UnpackedTarball/firebird/src/include/firebird/IdlFbInterfaces.h:9010:44 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/plugins/libEngine12.so +0x16eefb6) > #15 in Firebird::IAttachment* Firebird::IProvider::createDatabase<Firebird::CheckStatusWrapper>(Firebird::CheckStatusWrapper*, char const*, unsigned int, unsigned char const*) at workdir/UnpackedTarball/firebird/src/include/firebird/IdlFbInterfaces.h:2034:23 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/lib/libfbclient.so.2 +0x49cc5d) > #16 in Why::Dispatcher::attachOrCreateDatabase(Firebird::CheckStatusWrapper*, bool, char const*, unsigned int, unsigned char const*) at workdir/UnpackedTarball/firebird/src/yvalve/why.cpp:5681:15 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/lib/libfbclient.so.2 +0x44d0ad) > #17 in Why::Dispatcher::createDatabase(Firebird::CheckStatusWrapper*, char const*, unsigned int, unsigned char const*) at workdir/UnpackedTarball/firebird/src/yvalve/why.cpp:5606:9 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/lib/libfbclient.so.2 +0x44e4d4) > #18 in PREPARSE_execute(Firebird::CheckStatusWrapper*, Why::YAttachment**, unsigned short, char const*, bool*, unsigned short) at workdir/UnpackedTarball/firebird/src/yvalve/preparse.cpp:288:26 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/lib/libfbclient.so.2 +0x56e738) > #19 in Why::UtilInterface::executeCreateDatabase(Firebird::CheckStatusWrapper*, unsigned int, char const*, unsigned int, unsigned char*) at workdir/UnpackedTarball/firebird/src/yvalve/utl.cpp:587:8 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/lib/libfbclient.so.2 +0x5ee78f) > #20 in Firebird::IUtilBaseImpl<Why::UtilInterface, Firebird::CheckStatusWrapper, Firebird::IVersionedImpl<Why::UtilInterface, Firebird::CheckStatusWrapper, Firebird::Inherit<Firebird::IUtil> > >::cloopexecuteCreateDatabaseDispatcher(Firebird::IUtil*, Firebird::IStatus*, unsigned int, char const*, unsigned int, unsigned char*) at workdir/UnpackedTarball/firebird/src/include/firebird/IdlFbInterfaces.h:12375:44 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/lib/libfbclient.so.2 +0x60ed0b) > #21 in Firebird::IAttachment* Firebird::IUtil::executeCreateDatabase<Firebird::CheckStatusWrapper>(Firebird::CheckStatusWrapper*, unsigned int, char const*, unsigned int, unsigned char*) at workdir/UnpackedTarball/firebird/src/include/firebird/IdlFbInterfaces.h:3504:23 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/bin/isql +0x603d95) > #22 in create_db(char const*, char*) at workdir/UnpackedTarball/firebird/temp/Debug/isql/isql.cpp:5314:38 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/bin/isql +0x5aee53) > #23 in frontend(char const*) at workdir/UnpackedTarball/firebird/temp/Debug/isql/isql.cpp:6152:10 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/bin/isql +0x59b585) > #24 in get_statement(char*, unsigned long, char const*) at workdir/UnpackedTarball/firebird/temp/Debug/isql/isql.cpp:7019:9 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/bin/isql +0x596084) > #25 in do_isql() at workdir/UnpackedTarball/firebird/temp/Debug/isql/isql.cpp:5481:9 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/bin/isql +0x57ba26) > #26 in ISQL_main(int, char**) at workdir/UnpackedTarball/firebird/temp/Debug/isql/isql.cpp:1693:3 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/bin/isql +0x575ecc) > #27 in main at workdir/UnpackedTarball/firebird/temp/Debug/isql/isql.cpp:1599:9 (workdir/UnpackedTarball/firebird/gen/Debug/firebird/bin/isql +0x575149) > #28 in __libc_start_main at /usr/src/debug/glibc-2.26-146-gd300041c53/csu/../csu/libc-start.c:308 (/lib64/libc.so.6 +0x20f29) > #29 in _start at <null> (workdir/UnpackedTarball/firebird/gen/Debug/firebird/bin/isql +0x423219) Change-Id: Iebff0484a792b711769f46c4823f806e9f9b2935 Reviewed-on: https://gerrit.libreoffice.org/52704 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'external')
-rw-r--r--external/firebird/ubsan.patch9
1 files changed, 9 insertions, 0 deletions
diff --git a/external/firebird/ubsan.patch b/external/firebird/ubsan.patch
index bdfbac26e2f8..5fe298539ec3 100644
--- a/external/firebird/ubsan.patch
+++ b/external/firebird/ubsan.patch
@@ -183,6 +183,15 @@
jumpLength = jumpNode.length + jumpNode.prefix;
// Check if this could be our split point (if we need to split)
+@@ -5391,7 +5391,7 @@
+ // First, store needed data for beforeInsertNode into tempData.
+ HalfStaticArray<UCHAR, MAX_KEY> tempBuf;
+ UCHAR* tempData = tempBuf.getBuffer(newLength);
+- memcpy(tempData, beforeInsertNode.data + newPrefix - beforeInsertNode.prefix, newLength);
++ if (newLength != 0) memcpy(tempData, beforeInsertNode.data + newPrefix - beforeInsertNode.prefix, newLength);
+
+ beforeInsertNode.prefix = newPrefix;
+ beforeInsertNode.length = newLength;
@@ -5611,7 +5611,7 @@
for (size_t i = 0; i < jumpNodes->getCount(); i++, index++)
{