Skip to content

Commit ff7212e

Browse files
Add ASan Travis build
1 parent ebd3bf2 commit ff7212e

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1"
9393
GOAL="install"
9494
BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-glibc-back-compat --enable-reduce-exports --enable-debug CXXFLAGS=\"-g0 -O2\""
95-
# x86_64 Linux (xenial, no depends, only system libs, sanitizers: thread (TSAN))
95+
# x86_64 Linux (xenial, no depends, only system libs, sanitizers: thread (TSan))
9696
- stage: test
9797
env: >-
9898
HOST=x86_64-unknown-linux-gnu
@@ -102,14 +102,15 @@ jobs:
102102
RUN_FUNCTIONAL_TESTS=false # Disabled for now. TODO identify suppressions or exclude specific tests
103103
GOAL="install"
104104
BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER --with-sanitizers=thread --disable-hardening --disable-asm CC=clang CXX=clang++"
105-
# x86_64 Linux (no depends, only system libs, sanitizers: undefined (UBSAN) + integer)
105+
# x86_64 Linux (no depends, only system libs, sanitizers: address/leak (ASan + LSan) + undefined (UBSan) + integer)
106106
- stage: test
107107
env: >-
108108
HOST=x86_64-unknown-linux-gnu
109109
PACKAGES="clang llvm python3-zmq qtbase5-dev qttools5-dev-tools libssl1.0-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libprotobuf-dev protobuf-compiler libqrencode-dev"
110110
NO_DEPENDS=1
111+
FUNCTIONAL_TESTS_CONFIG="--exclude wallet_multiwallet.py" # Temporarily suppress ASan heap-use-after-free (see issue #14163)
111112
GOAL="install"
112-
BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER --with-sanitizers=integer,undefined CC=clang CXX=clang++"
113+
BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER --with-sanitizers=address,integer,undefined CC=clang CXX=clang++"
113114
# x86_64 Linux, No wallet
114115
- stage: test
115116
env: >-

.travis/test_04_install.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
export LC_ALL=C.UTF-8
88

99
travis_retry docker pull "$DOCKER_NAME_TAG"
10+
export ASAN_OPTIONS=""
11+
export LSAN_OPTIONS="suppressions=${TRAVIS_BUILD_DIR}/test/sanitizer_suppressions/lsan"
1012
export TSAN_OPTIONS="suppressions=${TRAVIS_BUILD_DIR}/test/sanitizer_suppressions/tsan"
1113
export UBSAN_OPTIONS="suppressions=${TRAVIS_BUILD_DIR}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1"
12-
env | grep -E '^(BITCOIN_CONFIG|CCACHE_|WINEDEBUG|LC_ALL|BOOST_TEST_RANDOM|CONFIG_SHELL|(TSAN|UBSAN)_OPTIONS)' | tee /tmp/env
14+
env | grep -E '^(BITCOIN_CONFIG|CCACHE_|WINEDEBUG|LC_ALL|BOOST_TEST_RANDOM|CONFIG_SHELL|(ASAN|LSAN|TSAN|UBSAN)_OPTIONS)' | tee /tmp/env
1315
if [[ $HOST = *-mingw32 ]]; then
1416
DOCKER_ADMIN="--cap-add SYS_ADMIN"
1517
fi

.travis/test_06_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ fi
5656

5757
if [ "$RUN_FUNCTIONAL_TESTS" = "true" ]; then
5858
BEGIN_FOLD functional-tests
59-
DOCKER_EXEC test/functional/test_runner.py --ci --combinedlogslen=4000 --coverage --quiet --failfast ${extended}
59+
DOCKER_EXEC test/functional/test_runner.py --ci --combinedlogslen=4000 --coverage --quiet --failfast ${extended} ${FUNCTIONAL_TESTS_CONFIG}
6060
END_FOLD
6161
fi

test/sanitizer_suppressions/lsan

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
leak:addCoin
2+
leak:libcrypto
3+
leak:libqminimal
4+
leak:libQt5Core
5+
leak:libQt5Gui
6+
leak:libQt5Widgets
7+
leak:new_allocator.h

0 commit comments

Comments
 (0)