[gnome-control-center] CI: add MSAN, TSAN and UBSAN Sanitizers



commit 92af703634b6acdd08ef7600a31393c783612a27
Author: Claudio André <claudioandre br gmail com>
Date:   Thu Jun 21 13:51:49 2018 -0300

    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.

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


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