Skip to content

Commit 2607c38

Browse files
author
MarcoFalke
committed
Merge #14764: travis: Run thread sanitizer on unit tests
fa7d36b test: Move UBSAN suppressions to test/sanitizer_suppressions/ubsan (MarcoFalke) fa36d4e travis: --disable-hardening for xenial thread sanitizer (MarcoFalke) 89bf196 travis: Run thread sanitizer (MarcoFalke) Pull request description: On unit tests only for now. Disabled for the gui unit tests and all functional tests. Tree-SHA512: 56f7d3b44e7cb68c76a2dc5abd85658955b1c2188932e988667c5a1cbcdd6be995d37bb949d62c6eb08a4aebfc43ff0370b7da1719d4e4f322a3495c1941a5e0
2 parents 59f05d1 + fa7d36b commit 2607c38

File tree

4 files changed

+32
-6
lines changed

4 files changed

+32
-6
lines changed

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,23 +92,24 @@ 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)
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
9999
DOCKER_NAME_TAG=ubuntu:16.04
100-
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"
100+
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"
101101
NO_DEPENDS=1
102+
RUN_FUNCTIONAL_TESTS=false # Disabled for now. TODO identify suppressions or exclude specific tests
102103
GOAL="install"
103-
BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --enable-glibc-back-compat --enable-reduce-exports --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER"
104+
BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER --with-sanitizers=thread --disable-hardening --disable-asm CC=clang CXX=clang++"
104105
# x86_64 Linux (no depends, only system libs, sanitizers: undefined (UBSAN) + integer)
105106
- stage: test
106107
env: >-
107108
HOST=x86_64-unknown-linux-gnu
108109
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"
109110
NO_DEPENDS=1
110111
GOAL="install"
111-
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++"
112+
BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER --with-sanitizers=integer,undefined CC=clang CXX=clang++"
112113
# x86_64 Linux, No wallet
113114
- stage: test
114115
env: >-

.travis/test_04_install.sh

Lines changed: 3 additions & 2 deletions
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 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
10+
export TSAN_OPTIONS="suppressions=${TRAVIS_BUILD_DIR}/test/sanitizer_suppressions/tsan"
11+
export UBSAN_OPTIONS="suppressions=${TRAVIS_BUILD_DIR}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1"
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)