Skip to content

Commit

Permalink
[SECP256K1] Add valgrind check to travis
Browse files Browse the repository at this point in the history
Summary:
```
As discussed in #687
This adds valgrind check to the repo.

It doesn't run on recovery+ecdh because of the time.
No openssl because of uninitialized mem.
I debated between with and without ASM, but decided with ASM because it
might be more fragile(?).

I wasn't sure if I should pass -DVALGRIND via CFLAGS or CPPFLAGS, it
seems like because this is only C then there shouldn't even be CPPFLAGS
but looks like we use CPPFLAGS in other places for the preprocessor
definitions.

If people are worried about the time it takes we can mark it as
allow_failure although I don't think it's a problem here because there's
only a handful of PRs and they're usually open for weeks.
```

Backport of secp256k1 [[bitcoin-core/secp256k1#690 | PR690]].

Depends on D5429, D5430 and D5431.

Test Plan:
Run the Travis build (see
https://travis-ci.org/Fabcien/secp256k1/builds/658345685).

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D5433
  • Loading branch information
elichai authored and Fabcien committed Mar 6, 2020
1 parent a6ba732 commit 14b0126
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,41 @@ jobs:
- libgmp-dev:i386
- ninja-build
install: ./travis/install_cmake.sh
- compiler: gcc
env:
- VALGRIND=yes
- BIGNUM=no ENDOMORPHISM=yes ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes OPENSSL_TESTS=no MULTISET=yes
- AUTOTOOLS_EXTRA_FLAGS=CPPFLAGS=-DVALGRIND AUTOTOOLS_TARGET=
- CMAKE_EXTRA_FLAGS=-DCMAKE_C_FLAGS=-DVALGRIND CMAKE_TARGET="tests exhaustive_tests"
addons:
apt:
packages:
- ninja-build
- valgrind
install: ./travis/install_cmake.sh
- compiler: gcc
env: # The same as above but without endomorphism.
- VALGRIND=yes
- BIGNUM=no ENDOMORPHISM=no ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes OPENSSL_TESTS=no MULTISET=yes
- AUTOTOOLS_EXTRA_FLAGS=CPPFLAGS=-DVALGRIND AUTOTOOLS_TARGET=
- CMAKE_EXTRA_FLAGS=-DCMAKE_C_FLAGS=-DVALGRIND CMAKE_TARGET="tests exhaustive_tests"
addons:
apt:
packages:
- ninja-build
- valgrind
install: ./travis/install_cmake.sh

script:
- ./travis/build_autotools.sh
- ./travis/build_cmake.sh
- # travis_wait extends the 10 minutes without output allowed (https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received)
- # the `--error-exitcode` is required to make the test fail if valgrind found errors, otherwise it'll return 0 (http://valgrind.org/docs/manual/manual-core.html)
- if [ -n "$VALGRIND" ]; then
travis_wait 30 valgrind --error-exitcode=42 ./buildautotools/tests 16 &&
travis_wait 30 valgrind --error-exitcode=42 ./buildautotools/exhaustive_tests;
fi
- if [ -n "$VALGRIND" ]; then
travis_wait 30 valgrind --error-exitcode=42 ./buildcmake/tests 16 &&
travis_wait 30 valgrind --error-exitcode=42 ./buildcmake/exhaustive_tests;
fi

0 comments on commit 14b0126

Please sign in to comment.