Skip to content

Commit 14b0126

Browse files
elichaiFabcien
authored andcommitted
[SECP256K1] Add valgrind check to travis
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
1 parent a6ba732 commit 14b0126

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.travis.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,41 @@ jobs:
9292
- libgmp-dev:i386
9393
- ninja-build
9494
install: ./travis/install_cmake.sh
95+
- compiler: gcc
96+
env:
97+
- VALGRIND=yes
98+
- BIGNUM=no ENDOMORPHISM=yes ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes OPENSSL_TESTS=no MULTISET=yes
99+
- AUTOTOOLS_EXTRA_FLAGS=CPPFLAGS=-DVALGRIND AUTOTOOLS_TARGET=
100+
- CMAKE_EXTRA_FLAGS=-DCMAKE_C_FLAGS=-DVALGRIND CMAKE_TARGET="tests exhaustive_tests"
101+
addons:
102+
apt:
103+
packages:
104+
- ninja-build
105+
- valgrind
106+
install: ./travis/install_cmake.sh
107+
- compiler: gcc
108+
env: # The same as above but without endomorphism.
109+
- VALGRIND=yes
110+
- BIGNUM=no ENDOMORPHISM=no ASM=x86_64 EXPERIMENTAL=yes ECDH=yes RECOVERY=yes OPENSSL_TESTS=no MULTISET=yes
111+
- AUTOTOOLS_EXTRA_FLAGS=CPPFLAGS=-DVALGRIND AUTOTOOLS_TARGET=
112+
- CMAKE_EXTRA_FLAGS=-DCMAKE_C_FLAGS=-DVALGRIND CMAKE_TARGET="tests exhaustive_tests"
113+
addons:
114+
apt:
115+
packages:
116+
- ninja-build
117+
- valgrind
118+
install: ./travis/install_cmake.sh
119+
95120
script:
96121
- ./travis/build_autotools.sh
97122
- ./travis/build_cmake.sh
123+
- # 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)
124+
- # 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)
125+
- if [ -n "$VALGRIND" ]; then
126+
travis_wait 30 valgrind --error-exitcode=42 ./buildautotools/tests 16 &&
127+
travis_wait 30 valgrind --error-exitcode=42 ./buildautotools/exhaustive_tests;
128+
fi
129+
- if [ -n "$VALGRIND" ]; then
130+
travis_wait 30 valgrind --error-exitcode=42 ./buildcmake/tests 16 &&
131+
travis_wait 30 valgrind --error-exitcode=42 ./buildcmake/exhaustive_tests;
132+
fi

0 commit comments

Comments
 (0)