From 8780aa9ca2d4ec56c48001b505749da19b5f07cd Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Tue, 23 Aug 2022 10:19:16 +0200 Subject: [PATCH 1/5] Enable use of AddressSanitizer in CI --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d2ac8d68..5a0fd91e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,6 +14,7 @@ build: - mkdir -p build - cd build - cmake + -DCMAKE_BUILD_TYPE:STRING=ASan -DCMAKE_PREFIX_PATH:STRING=/usr/local -DCMAKE_INSTALL_PREFIX:STRING=${CI_PROJECT_DIR}/compiled -DSCORD_BUILD_EXAMPLES:BOOL=ON -- GitLab From 2817c9bd48a3ddc44c4c804769176b9fabcdb84c Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Tue, 23 Aug 2022 10:25:14 +0200 Subject: [PATCH 2/5] Configure LSAN_OPTIONS for unit tests --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5a0fd91e..36bd5deb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -55,6 +55,7 @@ unit: stage: test needs: [build] script: + - export LSAN_OPTIONS=verbosity=1:log_threads=1 - export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64:${CI_PROJECT_DIR}/compiled/lib - cd build/tests - ctest -j$(nproc) --output-junit report.xml -- GitLab From 6b25a8563c7708ea3261d0a196573328be2109a0 Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Tue, 23 Aug 2022 11:24:46 +0200 Subject: [PATCH 3/5] Make ASan ignore ODR violations --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 36bd5deb..120ba129 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -55,6 +55,7 @@ unit: stage: test needs: [build] script: + - export ASAN_OPTIONS=detect_odr_violation=0 - export LSAN_OPTIONS=verbosity=1:log_threads=1 - export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64:${CI_PROJECT_DIR}/compiled/lib - cd build/tests -- GitLab From c975f3322f8fcbf05957d245d2f48cdb7d085201 Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Tue, 23 Aug 2022 11:26:38 +0200 Subject: [PATCH 4/5] Configure LSan suppressions for external libraries --- .gitlab-ci.yml | 4 +++- tests/LSanSuppress.supp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 tests/LSanSuppress.supp diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 120ba129..5c4060e5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,6 +45,8 @@ rpc: stage: test needs: [build] script: + - export ASAN_OPTIONS=detect_odr_violation=0 + - export LSAN_OPTIONS=verbosity=1:log_threads=1:suppressions=tests/LSanSuppress.supp - export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64:${CI_PROJECT_DIR}/compiled/lib - compiled/bin/scord -f --force-console & - build/examples/cxx/ADM_ping ofi+tcp://127.0.0.1:52000 @@ -56,7 +58,7 @@ unit: needs: [build] script: - export ASAN_OPTIONS=detect_odr_violation=0 - - export LSAN_OPTIONS=verbosity=1:log_threads=1 + - export LSAN_OPTIONS=verbosity=1:log_threads=1:suppressions=${CI_PROJECT_DIR}/tests/LSanSuppress.supp - export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64:${CI_PROJECT_DIR}/compiled/lib - cd build/tests - ctest -j$(nproc) --output-junit report.xml diff --git a/tests/LSanSuppress.supp b/tests/LSanSuppress.supp new file mode 100644 index 00000000..d0b3d8a1 --- /dev/null +++ b/tests/LSanSuppress.supp @@ -0,0 +1 @@ +leak:__margo_handle_cache -- GitLab From cfb315450b212b557f72f20441932715f9de0527 Mon Sep 17 00:00:00 2001 From: Alberto Miranda Date: Tue, 23 Aug 2022 11:36:30 +0200 Subject: [PATCH 5/5] Enable CTest output on failure --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5c4060e5..0bb8359b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -61,7 +61,7 @@ unit: - export LSAN_OPTIONS=verbosity=1:log_threads=1:suppressions=${CI_PROJECT_DIR}/tests/LSanSuppress.supp - export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64:${CI_PROJECT_DIR}/compiled/lib - cd build/tests - - ctest -j$(nproc) --output-junit report.xml + - ctest -j$(nproc) --output-on-failure --output-junit report.xml artifacts: expire_in: 1 week paths: -- GitLab