From f335455658ec8ebd6e60c4f9060fd2f180f2e14f Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 17 Mar 2024 18:42:44 +0800 Subject: [PATCH] script/run-make: enable ASan when performing tests, we should enable sanitizers for detecting potential issues. so, in this change, we enable ASsan, TSan and UBSan. script/run-make.sh is used by our CI job for testing PRs, so enabling these sanitizers helps us to identify issues as early as possible. because ASan cannot be used along with TSan, we prefer using ASan for capturing memory related issue in favor of detecting the multi-threading issues. also, because of https://bugs.llvm.org/show_bug.cgi?id=23272, we cannot enable multiple sanitizers. but we should enable UBSan as well, once we can use a higher version of Clang than Clang-14. with Clang-14, when enabling UBSan, we'd have following FTBFS ``` error: Cannot represent a difference across sections ``` when compiling `src/tools/neorados.cc` Signed-off-by: Kefu Chai --- src/script/run-make.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/script/run-make.sh b/src/script/run-make.sh index 52d43d3a171657..cc84cc8d6b98ca 100755 --- a/src/script/run-make.sh +++ b/src/script/run-make.sh @@ -98,6 +98,7 @@ EOM local cxx_compiler="${discovered_cxx_compiler}" local c_compiler="${discovered_c_compiler}" local cmake_opts + cmake_opts+=" -DWITH_ASAN=ON" cmake_opts+=" -DCMAKE_CXX_COMPILER=$cxx_compiler -DCMAKE_C_COMPILER=$c_compiler" cmake_opts+=" -DCMAKE_CXX_FLAGS_DEBUG=-Werror" cmake_opts+=" -DENABLE_GIT_VERSION=OFF"