summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorClaudio André <claudioandre.br@gmail.com>2018-07-12 17:22:28 -0300
committerBenjamin Berg <bberg@redhat.com>2019-02-04 15:19:31 +0100
commit0e291d4028f6e558853c7291f3cbdf309f9a8ffe (patch)
tree62b287955d64944180dde77bc9b4279b54a62de3 /.gitlab-ci.yml
parentdf4e2bbd02494c0c7ffe9041c717f039ec6fc39b (diff)
downloadgnome-settings-daemon-0e291d4028f6e558853c7291f3cbdf309f9a8ffe.tar.gz
CI: add ASAN, MSAN, TSAN and UBSAN Sanitizers
AddressSanitizer (or ASan) is a programming tool that detects memory corruption bugs such as buffer overflows or use after free. AddressSanitizer is based on compiler instrumentation. 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.
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml32
1 files changed, 32 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5eec8941..ce3663bb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,6 +2,7 @@ image: registry.gitlab.gnome.org/gnome/gnome-settings-daemon:fedora.dev
stages:
- build
- test
+ - manual
.Log files: &log_files [./*.log, _build/meson-logs/]
@@ -80,3 +81,34 @@ test:
echo "== Testing =="
meson test -C _build --verbose --no-stdsplit
fi
+
+# Runs the sanitizers [address, thread, undefined, and memory].
+.sanitizer: &sanitizer
+ <<: *save_build_logs
+ stage: manual
+ when: manual
+ script:
+ - *environment_information
+ - *build_procedure
+ - *run_tests
+
+asan:
+ <<: *sanitizer
+ variables:
+ BUILD_OPTS: "-Db_sanitize=address"
+
+tsan:
+ <<: *sanitizer
+ variables:
+ BUILD_OPTS: "-Db_sanitize=thread"
+
+ubsan:
+ <<: *sanitizer
+ variables:
+ BUILD_OPTS: "-Db_sanitize=undefined"
+
+msan:
+ <<: *sanitizer
+ variables:
+ BUILD_OPTS: "-Db_sanitize=memory"
+ CC: "clang"