mapleFU commented on code in PR #2298:
URL: https://github.com/apache/kvrocks/pull/2298#discussion_r1596269519
##########
CMakeLists.txt:
##########
@@ -91,6 +92,34 @@ if(ENABLE_ASAN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
endif()
+
+# Copied from
https://github.com/apache/arrow/blob/main/cpp/cmake_modules/san-config.cmake
+#
+# Flag to enable clang undefined behavior sanitizer
+# We explicitly don't enable all of the sanitizer flags:
+# - disable 'vptr' because of RTTI issues across shared libraries (?)
+# - disable 'alignment' because unaligned access is really OK on Nehalem and
we do it
+# all over the place.
+# - disable 'function' because it appears to give a false positive
+# (https://github.com/google/sanitizers/issues/911)
+# - disable 'float-divide-by-zero' on clang, which considers it UB
+# (https://bugs.llvm.org/show_bug.cgi?id=17000#c1)
+# Note: GCC does not support the 'function' flag.
+if(ENABLE_UBSAN)
Review Comment:
> Could UBSan be enabled with TSan and ASan? If no we'd better to check.
It can be used with ASAN and TSAN
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]