Skip to content

Commit d864e45

Browse files
author
MarcoFalke
committed
Merge #14673: travis: Fail the UBSan Travis build in case of newly introduced UBSan errors
4773fa8 Add llvm-symbolizer directory to PATH. Needed to get symbolized stack traces from the sanitizers. (practicalswift) 5c292da Add UBSan suppressions needed to pass test suite (practicalswift) fced6b5 Add UBSan options: print_stacktrace + halt_on_error (practicalswift) Pull request description: Fail the UBSan Travis build in case of newly introduced [UBSan (UndefinedBehaviorSanitizer)](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html) errors. Prior to this commit new UBSan errors were printed but didn't fail the UBSan Travis build. Changes: * Travis: Add UBSan options: `print_stacktrace` + `halt_on_error` * Travis: Add UBSan suppressions needed to pass test suite * Travis: Add `llvm-symbolizer` directory to PATH. Needed to get symbolized stack traces from the sanitizers. `halt_on_error` should have been part of #14252 really :-) Tree-SHA512: 30e960659196873d4f636f3a61267b8b4441a0e8773e3f3ae4660a9341d028c363636f0cb919ef9d6662ceb484e3d58054adfb6dc76ff8a355a1c9f927c328d1
2 parents 976583e + 4773fa8 commit d864e45

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
- stage: test
108108
env: >-
109109
HOST=x86_64-unknown-linux-gnu
110-
PACKAGES="clang 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"
110+
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"
111111
NO_DEPENDS=1
112112
GOAL="install"
113113
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++"

.travis/test_03_before_install.sh

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

99
PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g")
10+
# Add llvm-symbolizer directory to PATH. Needed to get symbolized stack traces from the sanitizers.
11+
PATH=$PATH:/usr/lib/llvm-6.0/bin/
1012
export PATH
1113

1214
BEGIN_FOLD () {

.travis/test_04_install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
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"
10+
export UBSAN_OPTIONS="suppressions=${TRAVIS_BUILD_DIR}/contrib/sanitizers-ubsan.suppressions:print_stacktrace=1:halt_on_error=1"
1111
env | grep -E '^(CCACHE_|WINEDEBUG|LC_ALL|BOOST_TEST_RANDOM|CONFIG_SHELL|UBSAN_OPTIONS)' | tee /tmp/env
1212
if [[ $HOST = *-mingw32 ]]; then
1313
DOCKER_ADMIN="--cap-add SYS_ADMIN"

contrib/sanitizers-ubsan.suppressions

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@ float-divide-by-zero:policy/fees.cpp
55
float-divide-by-zero:validation.cpp
66
float-divide-by-zero:wallet/wallet.cpp
77
nonnull-attribute:support/cleanse.cpp
8+
unsigned-integer-overflow:arith_uint256.h
89
unsigned-integer-overflow:basic_string.h
910
unsigned-integer-overflow:bench/bench.h
11+
unsigned-integer-overflow:bitcoin-tx.cpp
1012
unsigned-integer-overflow:bloom.cpp
13+
unsigned-integer-overflow:chain.cpp
1114
unsigned-integer-overflow:chain.h
15+
unsigned-integer-overflow:coded_stream.h
16+
unsigned-integer-overflow:core_write.cpp
1217
unsigned-integer-overflow:crypto/chacha20.cpp
1318
unsigned-integer-overflow:crypto/ctaes/ctaes.c
1419
unsigned-integer-overflow:crypto/ripemd160.cpp
@@ -21,7 +26,11 @@ unsigned-integer-overflow:leveldb/util/bloom.cc
2126
unsigned-integer-overflow:leveldb/util/crc32c.h
2227
unsigned-integer-overflow:leveldb/util/hash.cc
2328
unsigned-integer-overflow:policy/fees.cpp
29+
unsigned-integer-overflow:prevector.h
2430
unsigned-integer-overflow:script/interpreter.cpp
2531
unsigned-integer-overflow:stl_bvector.h
32+
unsigned-integer-overflow:streams.h
2633
unsigned-integer-overflow:txmempool.cpp
34+
unsigned-integer-overflow:util/strencodings.cpp
2735
unsigned-integer-overflow:validation.cpp
36+
vptr:fs.cpp

0 commit comments

Comments
 (0)