summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio André <claudioandre.br@gmail.com>2018-06-21 13:51:49 -0300
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2018-07-11 07:56:57 +0000
commit92af703634b6acdd08ef7600a31393c783612a27 (patch)
tree6fdac31283b9f5584e1dae84b1af078518bd00f8
parente91208eeb5799e966b4d81fac50364e1bbba415f (diff)
downloadgnome-control-center-92af703634b6acdd08ef7600a31393c783612a27.tar.gz
CI: add MSAN, TSAN and UBSAN Sanitizers
MemorySanitizer (MSan) is a detector of uninitialized memory reads in C/C++ programs. Uninitialized values occur when stack- or heap-allocated memory is read before it is written. ThreadSanitizer is a tool that detects data races. UndefinedBehaviorSanitizer (UBSan) is a fast undefined behavior detector. UBSan catches various kinds of undefined behavior, for example: - Using misaligned or null pointer - Signed integer overflow - Conversion to, from, or between floating-point types which would overflow the destination The llvm.org states that Sanitizers have found thousands of bugs everywhere. Sanitizers running during CI can prevent bugs from taking up residence. They are helper tools to maintain bugs out.
-rw-r--r--.gitlab-ci.yml37
1 files changed, 37 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 91b9deec4..fbf97c4b1 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,6 +2,7 @@ image: claudioandre/settings:job-502.6_fedora.dev # temporarily pinned to old t
stages:
- build
- test
+ - extra
- delivery
.Log files: &log_files [./*.log, _build/meson-logs/]
@@ -195,3 +196,39 @@ packaging:
name: review/$CI_COMMIT_REF_NAME
url: https://gitlab.gnome.org/$CI_PROJECT_PATH/-/jobs/$CI_JOB_ID/artifacts/raw/${BUNDLE}
when: manual
+
+##
+# Stage: Extra
+#
+# Runs the sanitizers [thread, undefined, memory].
+##
+.sanitizer: &sanitizer
+ <<: *save_build_logs
+ stage: extra
+ allow_failure: true
+
+ script:
+ - *environment_information
+ - *build_procedure
+
+ - echo "== Testing =="
+ - ninja -C _build test
+
+tsan:
+ <<: *sanitizer
+ variables:
+ BUILD_OPTS: "-Db_sanitize=thread"
+ when: manual
+
+ubsan:
+ <<: *sanitizer
+ variables:
+ BUILD_OPTS: "-Db_sanitize=undefined"
+ when: manual
+
+msan:
+ <<: *sanitizer
+ variables:
+ BUILD_OPTS: "-Db_sanitize=memory"
+ CC: "clang"
+ when : manual