From f3cae6be43457e8a7837b53f5f4e60068feffca2 Mon Sep 17 00:00:00 2001 From: Jonas Nick Date: Sun, 3 Nov 2019 23:16:09 +0000 Subject: [PATCH] Add a clang memory sanitizer test to travis --- .travis.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2c65be6cd2..3baa5a6d04 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,6 +61,34 @@ matrix: packages: - gcc-multilib - libgmp-dev:i386 + + # clang with memory sanitizer + # + # --disable-openssl-tests because openssl uses uninitialized memory. ASM + # and BIGNUM are disabled because clang memory sanitizer does not work + # with inline assembly (https://clang.llvm.org/docs/MemorySanitizer.html). + # The memory sanitizer is instructed to exit with a different exit code + # using MSAN_OPTIONS. This is because the default exit code is 77 - the + # same exit code that autotools make check interprets as a test that is + # supposed to be skipped. + # + # With endomorphism + - compiler: clang + env: + - CFLAGS="-fsanitize=memory -fno-omit-frame-pointer -g" + - ASM=no BIGNUM=no EXTRAFLAGS="--disable-openssl-tests" + - EXPERIMENTAL=yes RECOVERY=yes ECDH=yes + - MSAN_OPTIONS=exitcode=42 + - ENDOMORPHISM=yes + # Memory sanitizer without endomorphism + - compiler: clang + env: + - CFLAGS="-fsanitize=memory -fno-omit-frame-pointer -g" + - ASM=no BIGNUM=no EXTRAFLAGS="--disable-openssl-tests" + - EXPERIMENTAL=yes RECOVERY=yes ECDH=yes + - MSAN_OPTIONS=exitcode=42 + - ENDOMORPHISM=no + before_install: mkdir -p `dirname $GUAVA_JAR` install: if [ ! -f $GUAVA_JAR ]; then wget $GUAVA_URL -O $GUAVA_JAR; fi before_script: ./autogen.sh