Travis CI: Also test with Memory and Unexpected Behavior sanitizers
authorIvan Maidanski <ivmai@mail.ru>
Fri, 17 Feb 2017 08:51:30 +0000 (11:51 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 17 Feb 2017 08:54:31 +0000 (11:54 +0300)
Note: Currently an error found by MSan/UBSan does not cause Travis build
to fail, the log should be examined manually for the absence of
"MemorySanitizer" and "runtime error" character sequences (the error
messages are shown in red).

.travis.yml

index b7c4019..7afe566 100644 (file)
@@ -20,6 +20,7 @@ env:
   - CSA_CHECK=true
       CPPCHECK=true
   - SANITIZE=address
+  - SANITIZE=memory,undefined
 
 matrix:
   exclude:
@@ -37,6 +38,10 @@ matrix:
     env: SANITIZE=address
   - os: osx
     env: SANITIZE=address
+  - compiler: gcc
+    env: SANITIZE=memory,undefined
+  - os: osx
+    env: SANITIZE=memory,undefined
 
 sudo: required
 
@@ -57,6 +62,10 @@ before_install:
   - if [[ "$SANITIZE" != "" ]]; then
       CFLAGS_EXTRA="$CFLAGS_EXTRA -fsanitize=$SANITIZE -fno-common -fno-omit-frame-pointer";
     fi
+# TODO: Issues found by MSan and UBSan do not cause the build to fail by now.
+# Travis Linux/clang-3.4 does not accept -fno-sanitize-recover=undefined,
+# and the sanitizer runtime does not seem to handle MSAN_OPTIONS="exitcode=1"
+# and UBSAN_OPTIONS="halt_on_error=1".
 
 install:
   - ./autogen.sh