From 1336a7742d8839096f0382cf0e4eeb0a8b0f076e Mon Sep 17 00:00:00 2001 From: Siying Dong Date: Wed, 7 Feb 2018 10:45:46 -0800 Subject: [PATCH] Disable alignment check in UBSAN Summary: Disable alignment check in UBSAN for now. Now we can't get signals to meaningful failures. We can reenable it after we figure out how we can suppress failures in finer grain manner. Closes https://github.com/facebook/rocksdb/pull/3473 Differential Revision: D6925971 Pulled By: siying fbshipit-source-id: a0f1a242cde866abbc5c1eeee9ff8d1d7d582ac4 --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a0ec59413a..d840bd6420 100644 --- a/Makefile +++ b/Makefile @@ -232,9 +232,13 @@ endif # USAN doesn't work well with jemalloc. If we're compiling with USAN, we should use regular malloc. ifdef COMPILE_WITH_UBSAN DISABLE_JEMALLOC=1 - EXEC_LDFLAGS += -fsanitize=undefined -fno-sanitize-recover - PLATFORM_CCFLAGS += -fsanitize=undefined -fno-sanitize-recover -DROCKSDB_UBSAN_RUN - PLATFORM_CXXFLAGS += -fsanitize=undefined -fno-sanitize-recover -DROCKSDB_UBSAN_RUN + # Suppress alignment warning because murmurhash relies on casting unaligned + # memory to integer. Fixing it may cause performance regression. 3-way crc32 + # relies on it too, although it can be rewritten to eliminate with minimal + # performance regression. + EXEC_LDFLAGS += -fsanitize=undefined -fno-sanitize-recover -fno-sanitize=alignment + PLATFORM_CCFLAGS += -fsanitize=undefined -fno-sanitize-recover -fno-sanitize=alignment -DROCKSDB_UBSAN_RUN + PLATFORM_CXXFLAGS += -fsanitize=undefined -fno-sanitize-recover -fno-sanitize=alignment -DROCKSDB_UBSAN_RUN endif ifdef ROCKSDB_VALGRIND_RUN