[gnome-settings-daemon/wip/claudio/CI: 8/13] CI: add ASAN, MSAN, TSAN and UBSAN Sanitizers



commit 0e291d4028f6e558853c7291f3cbdf309f9a8ffe
Author: Claudio André <claudioandre br gmail com>
Date:   Thu Jul 12 17:22:28 2018 -0300

    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.

 .gitlab-ci.yml | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
---
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"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]