Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add memory sanitizer test to travis #687

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,34 @@ matrix:
packages:
- gcc-multilib
- libgmp-dev:i386

# clang with memory sanitizer
#
# --disable-openssl-tests because openssl uses uninitialized memory. ASM
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I haven't checked this myself, but an alternative might be to export MSAN_OPTIONS with a suppressions file for the openssl function that is affected.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed but I don't think that's better in the end, and disabling the tests as done here is simpler. Note that the flag here really just influences just the test code. OpenSSL is only used in the tests, not used in the library itself.

# 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
Expand Down