Skip to content

Commit 89bf196

Browse files
author
MarcoFalke
committed
travis: Run thread sanitizer
1 parent 384967f commit 89bf196

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,23 +94,24 @@ jobs:
9494
DEP_OPTS="NO_QT=1 NO_UPNP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1"
9595
GOAL="install"
9696
BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-glibc-back-compat --enable-reduce-exports --enable-debug CXXFLAGS=\"-g0 -O2\""
97-
# x86_64 Linux (xenial, no depends, only system libs)
97+
# x86_64 Linux (xenial, no depends, only system libs, sanitizers: thread (TSAN))
9898
- stage: test
9999
env: >-
100100
HOST=x86_64-unknown-linux-gnu
101101
DOCKER_NAME_TAG=ubuntu:16.04
102-
PACKAGES="python3-zmq qtbase5-dev qttools5-dev-tools libssl-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"
102+
PACKAGES="clang llvm python3-zmq qtbase5-dev qttools5-dev-tools libssl-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"
103103
NO_DEPENDS=1
104+
RUN_FUNCTIONAL_TESTS=false # Disabled for now. TODO identify suppressions or exclude specific tests
104105
GOAL="install"
105-
BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --enable-glibc-back-compat --enable-reduce-exports --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER"
106+
BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER --with-sanitizers=thread CC=clang CXX=clang++"
106107
# x86_64 Linux (no depends, only system libs, sanitizers: undefined (UBSAN) + integer)
107108
- stage: test
108109
env: >-
109110
HOST=x86_64-unknown-linux-gnu
110111
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"
111112
NO_DEPENDS=1
112113
GOAL="install"
113-
BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --enable-glibc-back-compat --enable-reduce-exports --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER --with-sanitizers=integer,undefined CC=clang CXX=clang++"
114+
BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER --with-sanitizers=integer,undefined CC=clang CXX=clang++"
114115
# x86_64 Linux, No wallet
115116
- stage: test
116117
env: >-

.travis/test_04_install.sh

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

99
travis_retry docker pull "$DOCKER_NAME_TAG"
10+
export TSAN_OPTIONS="suppressions=${TRAVIS_BUILD_DIR}/test/sanitizer_suppressions/tsan"
1011
export UBSAN_OPTIONS="suppressions=${TRAVIS_BUILD_DIR}/contrib/sanitizers-ubsan.suppressions:print_stacktrace=1:halt_on_error=1"
11-
env | grep -E '^(CCACHE_|WINEDEBUG|LC_ALL|BOOST_TEST_RANDOM|CONFIG_SHELL|UBSAN_OPTIONS)' | tee /tmp/env
12+
env | grep -E '^(CCACHE_|WINEDEBUG|LC_ALL|BOOST_TEST_RANDOM|CONFIG_SHELL|(TSAN|UBSAN)_OPTIONS)' | tee /tmp/env
1213
if [[ $HOST = *-mingw32 ]]; then
1314
DOCKER_ADMIN="--cap-add SYS_ADMIN"
1415
fi

test/sanitizer_suppressions/tsan

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# ThreadSanitizer suppressions
2+
# ============================
3+
4+
# fChecked is theoretically racy, practically only in unit tests
5+
race:CheckBlock
6+
7+
# WalletBatch (unidentified deadlock)
8+
deadlock:WalletBatch
9+
10+
# Intentional deadlock in tests
11+
deadlock:TestPotentialDeadLockDetected
12+
13+
# Wildcard for all gui tests, should be replaced with non-wildcard suppressions
14+
race:src/qt/test/*
15+
deadlock:src/qt/test/*
16+
17+
# WIP: Unidentified suppressions to run the functional tests
18+
#race:zmqpublishnotifier.cpp
19+
#
20+
#deadlock:CreateWalletFromFile
21+
#deadlock:importprivkey
22+
#deadlock:walletdb.h
23+
#deadlock:walletdb.cpp
24+
#deadlock:wallet/db.cpp

0 commit comments

Comments
 (0)