Skip to content

Commit

Permalink
partial merge bitcoin#14794: Add AddressSanitizer (ASan) Travis build
Browse files Browse the repository at this point in the history
  • Loading branch information
knst authored and PastaPastaPasta committed Jun 7, 2023
1 parent 50cac39 commit a3c59cc
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,15 @@ linux64_fuzz-build:
variables:
BUILD_TARGET: linux64_fuzz

linux64_asan-build:
extends:
- .build-template
- .skip-in-fast-mode-template
needs:
- x86_64-pc-linux-gnu-debug
variables:
BUILD_TARGET: linux64_asan

linux64_tsan-build:
extends:
- .build-template
Expand Down Expand Up @@ -315,6 +324,15 @@ linux64_sqlite-test:
variables:
BUILD_TARGET: linux64_sqlite

linux64_asan-test:
extends:
- .test-template
- .skip-in-fast-mode-template
needs:
- linux64_asan-build
variables:
BUILD_TARGET: linux64_asan

linux64_tsan-test:
extends:
- .test-template
Expand Down
4 changes: 4 additions & 0 deletions ci/dash/matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export LC_ALL=C.UTF-8
source ./ci/test/00_setup_env.sh

# Configure sanitizers options
export ASAN_OPTIONS=""
export LSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/lsan"
export TSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/tsan"
export UBSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/ubsan"

Expand All @@ -20,6 +22,8 @@ elif [ "$BUILD_TARGET" = "win64" ]; then
source ./ci/test/00_setup_env_win64.sh
elif [ "$BUILD_TARGET" = "linux64" ]; then
source ./ci/test/00_setup_env_native_qt5.sh
elif [ "$BUILD_TARGET" = "linux64_asan" ]; then
source ./ci/test/00_setup_env_native_asan.sh
elif [ "$BUILD_TARGET" = "linux64_tsan" ]; then
source ./ci/test/00_setup_env_native_tsan.sh
elif [ "$BUILD_TARGET" = "linux64_ubsan" ]; then
Expand Down
14 changes: 14 additions & 0 deletions ci/test/00_setup_env_native_asan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
#
# Copyright (c) 2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

export LC_ALL=C.UTF-8

export PACKAGES="clang llvm python3-zmq qtbase5-dev qttools5-dev-tools libevent-dev bsdmainutils libboost-filesystem-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libqrencode-dev"
export NO_DEPENDS=1
export FUNCTIONAL_TESTS_CONFIG="--exclude wallet_multiwallet.py" # Temporarily suppress ASan heap-use-after-free (see issue #14163)
export RUN_BENCH=true
export GOAL="install"
export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER --with-sanitizers=address,integer,undefined CC=clang CXX=clang++"

0 comments on commit a3c59cc

Please sign in to comment.