diff --git a/.cirrus.yml b/.cirrus.yml index 506bfceb217c6..2dd109af6a1b8 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -37,7 +37,7 @@ task: timeout_in: 60m env: MAKEJOBS: "-j9" - RUN_CI_ON_HOST: "1" + DANGER_RUN_CI_ON_HOST: "1" CCACHE_SIZE: "200M" CCACHE_DIR: "/tmp/ccache_dir" ccache_cache: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a0527f648ec1a..0d33c1ab9ae80 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 @@ -279,6 +288,15 @@ linux64_nowallet-build: variables: BUILD_TARGET: linux64_nowallet +#linux64_valgrind-build: +# extends: +# - .build-template +# - .skip-in-fast-mode-template +# needs: +# - x86_64-pc-linux-gnu-debug +# variables: +# BUILD_TARGET: linux64_valgrind + mac-build: extends: - .build-template @@ -306,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 @@ -323,3 +350,12 @@ linux64_ubsan-test: - linux64_ubsan-build variables: BUILD_TARGET: linux64_ubsan + +#linux64_valgrind-test: +# extends: +# - .test-template +# - .skip-in-fast-mode-template +# needs: +# - linux64_valgrind-build +# variables: +# BUILD_TARGET: linux64_valgrind diff --git a/.travis.yml b/.travis.yml index 309b9cdbb0518..e135852c3958f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,6 +17,8 @@ # will trigger cache-invalidation and rebuilds as necessary. # +version: ~> 1.0 + dist: xenial os: linux @@ -30,9 +32,6 @@ cache: ccache: true directories: - $BASE_BUILD_DIR/ci/scratch/.ccache - # macOS - - $HOME/Library/Caches/Homebrew - - /usr/local/Homebrew before_cache: - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then brew cleanup; fi env: @@ -205,19 +204,39 @@ after_success: - stage: test name: 'ARM [GOAL: install] [focal] [unit tests, functional tests]' - arch: arm64 + arch: arm64 # Can disable QEMU_USER_CMD and run the tests natively without qemu env: >- FILE_ENV="./ci/test/00_setup_env_arm.sh" - QEMU_USER_CMD="" # Can run the tests natively without qemu + QEMU_USER_CMD="" + + - stage: test + name: 's390x native BE [GOAL: install] [bionic] [no depends, no GUI]' + arch: s390x + dist: bionic + addons: + apt: + packages: + - bsdmainutils + - libboost-filesystem-dev + - libboost-system-dev + - libboost-test-dev + - libboost-thread-dev + - libdb++-dev + - libdb-dev + - libevent-dev + env: >- + DANGER_RUN_CI_ON_HOST=true + CI_USE_APT_INSTALL=no + FILE_ENV="./ci/test/00_setup_env_s390x_host.sh" # s390 build was disabled temporarily because of disk space issues on the Travis VM # # - stage: test # name: 'S390x [GOAL: install] [focal] [unit tests, functional tests]' -# arch: s390x +# arch: s390x # Can disable QEMU_USER_CMD and run the tests natively without qemu # env: >- # FILE_ENV="./ci/test/00_setup_env_s390x.sh" -# QEMU_USER_CMD="" # Can run the tests natively without qemu +# QEMU_USER_CMD="" - stage: test name: 'Win64 [GOAL: deploy] [unit tests, no gui, no functional tests]' @@ -225,7 +244,7 @@ after_success: FILE_ENV="./ci/test/00_setup_env_win64.sh" - stage: test - name: 'x86_64 Linux [GOAL: install] [focal] [uses qt5 dev package instead of depends Qt to speed up build and avoid timeout] [unsigned char]' + name: 'x86_64 Linux [GOAL: install] [focal] [uses qt5 dev package and some depends packages] [unsigned char]' env: >- FILE_ENV="./ci/test/00_setup_env_native_qt5.sh" # x86_64 Linux (xenial, no depends, only system libs, sanitizers: thread (TSan)) @@ -251,6 +270,7 @@ after_success: FILE_ENV="./ci/test/00_setup_env_native_fuzz_with_valgrind.sh" - stage: test + name: 'x86_64 Linux [GOAL: install] [focal] [no wallet]' env: >- FILE_ENV="./ci/test/00_setup_env_native_nowallet.sh" @@ -263,8 +283,28 @@ after_success: name: 'macOS 10.14 native [GOAL: install] [GUI] [no depends]' os: osx # Use the most recent version: - # Xcode 11, macOS 10.14, JDK 12.0.1 + # Xcode 11.3.1, macOS 10.14, SDK 10.15 # https://docs.travis-ci.com/user/reference/osx/#macos-version - osx_image: xcode11 + osx_image: xcode11.3 + cache: + directories: + - $TRAVIS_BUILD_DIR/ci/scratch/.ccache + - $TRAVIS_BUILD_DIR/releases/$HOST + - $HOME/Library/Caches/Homebrew + - /usr/local/Homebrew + addons: + homebrew: + packages: + - libtool + - berkeley-db4 + - boost + - miniupnpc + - qt + - qrencode + - python3 + - ccache + - zeromq env: >- + DANGER_RUN_CI_ON_HOST=true + CI_USE_APT_INSTALL=no FILE_ENV="./ci/test/00_setup_env_mac_host.sh" diff --git a/ci/dash/build_src.sh b/ci/dash/build_src.sh index d4dd37c55c5ac..7dc5a3a03d0a9 100755 --- a/ci/dash/build_src.sh +++ b/ci/dash/build_src.sh @@ -56,6 +56,11 @@ cd dashcore-$BUILD_TARGET make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && make $GOAL V=1 ; false ) +if [ -n "$USE_VALGRIND" ]; then + echo "valgrind in USE!" + ${BASE_ROOT_DIR}/ci/test/wrap-valgrind.sh +fi + if [ "$RUN_SYMBOL_TESTS" = "true" ]; then make $MAKEJOBS -C src check-symbols fi diff --git a/ci/dash/matrix.sh b/ci/dash/matrix.sh index 3f8f35bc4b277..26dcba42efc32 100755 --- a/ci/dash/matrix.sh +++ b/ci/dash/matrix.sh @@ -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" @@ -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 @@ -32,6 +36,8 @@ elif [ "$BUILD_TARGET" = "linux64_sqlite" ]; then source ./ci/test/00_setup_env_native_sqlite.sh elif [ "$BUILD_TARGET" = "linux64_nowallet" ]; then source ./ci/test/00_setup_env_native_nowallet.sh +elif [ "$BUILD_TARGET" = "linux64_valgrind" ]; then + source ./ci/test/00_setup_env_native_valgrind.sh elif [ "$BUILD_TARGET" = "mac" ]; then source ./ci/test/00_setup_env_mac.sh elif [ "$BUILD_TARGET" = "s390x" ]; then diff --git a/ci/dash/test_unittests.sh b/ci/dash/test_unittests.sh index e97d234348f19..0b7bbf46db202 100755 --- a/ci/dash/test_unittests.sh +++ b/ci/dash/test_unittests.sh @@ -11,7 +11,7 @@ set -e source ./ci/dash/matrix.sh -if [ "$RUN_UNIT_TESTS" != "true" ]; then +if [ "$RUN_UNIT_TESTS" != "true" ] && [ "$RUN_UNIT_TESTS_SEQUENTIAL" != "true" ]; then echo "Skipping unit tests" exit 0 fi @@ -29,5 +29,9 @@ if [ "$DIRECT_WINE_EXEC_TESTS" = "true" ]; then # Inside Docker, binfmt isn't working so we can't trust in make invoking windows binaries correctly wine ./src/test/test_dash.exe else - make $MAKEJOBS check VERBOSE=1 + if [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then + ./src/test/test_dash --catch_system_errors=no -l test_suite + else + make $MAKEJOBS check VERBOSE=1 + fi fi diff --git a/ci/test/00_setup_env_mac_host.sh b/ci/test/00_setup_env_mac_host.sh index 6e23046b79a80..dea7925e851a7 100755 --- a/ci/test/00_setup_env_mac_host.sh +++ b/ci/test/00_setup_env_mac_host.sh @@ -8,9 +8,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_macos export HOST=x86_64-apple-darwin19 -export BREW_PACKAGES="automake berkeley-db4 libtool boost miniupnpc pkg-config qt qrencode python3 ccache zeromq" export PIP_PACKAGES="zmq" -export RUN_CI_ON_HOST=true export RUN_UNIT_TESTS=true export RUN_INTEGRATION_TESTS=false export GOAL="install" diff --git a/ci/test/00_setup_env_native_asan.sh b/ci/test/00_setup_env_native_asan.sh new file mode 100644 index 0000000000000..0e15669347930 --- /dev/null +++ b/ci/test/00_setup_env_native_asan.sh @@ -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++" diff --git a/ci/test/00_setup_env_native_fuzz.sh b/ci/test/00_setup_env_native_fuzz.sh index 7aad5ca06b531..44a6ff494f8f4 100755 --- a/ci/test/00_setup_env_native_fuzz.sh +++ b/ci/test/00_setup_env_native_fuzz.sh @@ -6,6 +6,7 @@ export LC_ALL=C.UTF-8 +export DOCKER_NAME_TAG="ubuntu:20.04" export CONTAINER_NAME=ci_native_fuzz export PACKAGES="clang llvm python3 libevent-dev bsdmainutils libboost-filesystem-dev libboost-test-dev libboost-thread-dev" export DEP_OPTS="NO_UPNP=1 DEBUG=1" diff --git a/ci/test/00_setup_env_native_fuzz_with_valgrind.sh b/ci/test/00_setup_env_native_fuzz_with_valgrind.sh index 16539a1df78a4..8e68bd7f318e9 100644 --- a/ci/test/00_setup_env_native_fuzz_with_valgrind.sh +++ b/ci/test/00_setup_env_native_fuzz_with_valgrind.sh @@ -6,13 +6,13 @@ export LC_ALL=C.UTF-8 +export DOCKER_NAME_TAG="ubuntu:20.04" export CONTAINER_NAME=ci_native_fuzz_valgrind -export PACKAGES="clang-8 llvm-8 python3 libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev valgrind" +export PACKAGES="clang llvm python3 libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-dev valgrind" export NO_DEPENDS=1 export RUN_UNIT_TESTS=false export RUN_FUNCTIONAL_TESTS=false export RUN_FUZZ_TESTS=true export FUZZ_TESTS_CONFIG="--valgrind" export GOAL="install" -export BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer --enable-c++17 CC=clang-8 CXX=clang++-8" -# Use clang-8, instead of default clang on bionic, which is clang-6 and does not come with libfuzzer on aarch64 +export BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer --enable-c++17 CC=clang CXX=clang++" diff --git a/ci/test/00_setup_env_native_qt5.sh b/ci/test/00_setup_env_native_qt5.sh index 38c9921a6bea0..4ee843d25bf66 100755 --- a/ci/test/00_setup_env_native_qt5.sh +++ b/ci/test/00_setup_env_native_qt5.sh @@ -11,5 +11,7 @@ export PACKAGES="python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libhar export DEP_OPTS="NO_UPNP=1 DEBUG=1" # TODO: we have few rpcs that aren't covered by any test, re-enable the line below once it's fixed # export TEST_RUNNER_EXTRA="--coverage --extended --exclude feature_pruning,feature_dbcrash" # Run extended tests so that coverage does not fail, but exclude the very slow dbcrash +export RUN_UNIT_TESTS_SEQUENTIAL="true" +export RUN_UNIT_TESTS="false" export GOAL="install" export BITCOIN_CONFIG="--enable-glibc-back-compat --enable-zmq --enable-reduce-exports LDFLAGS=-static-libstdc++" diff --git a/ci/test/00_setup_env_native_valgrind.sh b/ci/test/00_setup_env_native_valgrind.sh new file mode 100644 index 0000000000000..fc10eea0d0145 --- /dev/null +++ b/ci/test/00_setup_env_native_valgrind.sh @@ -0,0 +1,18 @@ +#!/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="valgrind clang llvm python3-zmq libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev" +export USE_VALGRIND=1 +export NO_DEPENDS=1 +if [[ "${TRAVIS}" == "true" && "${TRAVIS_REPO_SLUG}" != "bitcoin/bitcoin" ]]; then + export TEST_RUNNER_EXTRA="wallet_disable" # Only run wallet_disable as a smoke test to not hit the 50 min travis time limit +else + export TEST_RUNNER_EXTRA="--exclude rpc_bind" # Excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547 +fi +export GOAL="install" +export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=no CC=clang CXX=clang++" # TODO enable GUI diff --git a/ci/test/00_setup_env_s390x_host.sh b/ci/test/00_setup_env_s390x_host.sh new file mode 100644 index 0000000000000..8f3063604ef7d --- /dev/null +++ b/ci/test/00_setup_env_s390x_host.sh @@ -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 HOST=s390x-linux-gnu +export NO_DEPENDS=1 +export BITCOIN_CONFIG="--with-incompatible-bdb --enable-reduce-exports" +export RUN_UNIT_TESTS=true +export RUN_FUNCTIONAL_TESTS=true +export GOAL="install" diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh index c5983c7d61198..92ef17c302f4e 100755 --- a/ci/test/04_install.sh +++ b/ci/test/04_install.sh @@ -14,30 +14,8 @@ if [[ $QEMU_USER_CMD == qemu-s390* ]]; then fi if [ "$TRAVIS_OS_NAME" == "osx" ]; then - set +o errexit - pushd /usr/local/Homebrew || exit 1 - git reset --hard origin/master - popd || exit 1 - set -o errexit - ${CI_RETRY_EXE} brew unlink python@2 - ${CI_RETRY_EXE} brew update - # brew upgrade returns an error if any of the packages is already up to date - # Failure is safe to ignore, unless we really need an update. - brew upgrade $BREW_PACKAGES || true - - # install new packages (brew install returns an error if already installed) - for i in $BREW_PACKAGES; do - if ! brew list | grep -q $i; then - ${CI_RETRY_EXE} brew install $i - fi - done - export PATH="/usr/local/opt/ccache/libexec:$PATH" - OPENSSL_PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig" - export PKG_CONFIG_PATH=$OPENSSL_PKG_CONFIG_PATH:$PKG_CONFIG_PATH - ${CI_RETRY_EXE} pip3 install $PIP_PACKAGES - fi mkdir -p "${BASE_SCRATCH_DIR}" @@ -47,7 +25,7 @@ export ASAN_OPTIONS="detect_stack_use_after_return=1:check_initialization_order= export LSAN_OPTIONS="suppressions=${BASE_BUILD_DIR}/test/sanitizer_suppressions/lsan" export TSAN_OPTIONS="suppressions=${BASE_BUILD_DIR}/test/sanitizer_suppressions/tsan" export UBSAN_OPTIONS="suppressions=${BASE_BUILD_DIR}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1" -env | grep -E '^(QEMU_|CCACHE_|WINEDEBUG|LC_ALL|BOOST_TEST_RANDOM|CONFIG_SHELL|(ASAN|LSAN|TSAN|UBSAN)_OPTIONS)' | tee /tmp/env +env | grep -E '^(BASE_|QEMU_|CCACHE_|WINEDEBUG|LC_ALL|BOOST_TEST_RANDOM|CONFIG_SHELL|(ASAN|LSAN|TSAN|UBSAN)_OPTIONS)' | tee /tmp/env if [[ $HOST = *-mingw32 ]]; then DOCKER_ADMIN="--cap-add SYS_ADMIN" elif [[ $BITCOIN_CONFIG = *--with-sanitizers=*address* ]]; then # If ran with (ASan + LSan), Docker needs access to ptrace (https://github.com/google/sanitizers/issues/764) @@ -56,7 +34,7 @@ fi export P_CI_DIR="$PWD" -if [ -z "$RUN_CI_ON_HOST" ]; then +if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then echo "Creating $DOCKER_NAME_TAG container to run in" ${CI_RETRY_EXE} docker pull "$DOCKER_NAME_TAG" @@ -87,7 +65,7 @@ fi if [[ $DOCKER_NAME_TAG == centos* ]]; then ${CI_RETRY_EXE} DOCKER_EXEC yum -y install epel-release ${CI_RETRY_EXE} DOCKER_EXEC yum -y install $DOCKER_PACKAGES $PACKAGES -elif [ "$TRAVIS_OS_NAME" != "osx" ]; then +elif [ "$CI_USE_APT_INSTALL" != "no" ]; then ${CI_RETRY_EXE} DOCKER_EXEC apt-get update ${CI_RETRY_EXE} DOCKER_EXEC apt-get install --no-install-recommends --no-upgrade -y $PACKAGES $DOCKER_PACKAGES fi @@ -98,18 +76,21 @@ if [ "$TRAVIS_OS_NAME" == "osx" ]; then else DOCKER_EXEC free -m -h DOCKER_EXEC echo "Number of CPUs \(nproc\):" \$\(nproc\) + DOCKER_EXEC echo $(lscpu | grep Endian) DOCKER_EXEC echo "Free disk space:" DOCKER_EXEC df -h fi if [ ! -d ${DIR_QA_ASSETS} ]; then + if [ "$RUN_FUZZ_TESTS" = "true" ]; then DOCKER_EXEC git clone https://github.com/bitcoin-core/qa-assets ${DIR_QA_ASSETS} + fi fi export DIR_FUZZ_IN=${DIR_QA_ASSETS}/fuzz_seed_corpus/ DOCKER_EXEC mkdir -p "${BASE_SCRATCH_DIR}/sanitizer-output/" -if [ -z "$RUN_CI_ON_HOST" ]; then +if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then echo "Create $BASE_ROOT_DIR" DOCKER_EXEC rsync -a /ro_base/ $BASE_ROOT_DIR fi diff --git a/ci/test/wrap-valgrind.sh b/ci/test/wrap-valgrind.sh new file mode 100755 index 0000000000000..d2192061dbc90 --- /dev/null +++ b/ci/test/wrap-valgrind.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2018 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 + +for b_name in "${BASE_OUTDIR}/bin"/*; do + # shellcheck disable=SC2044 + for b in $(find "${BASE_ROOT_DIR}" -executable -type f -name $(basename $b_name)); do + echo "Wrap $b ..." + mv "$b" "${b}_orig" + echo '#!/usr/bin/env bash' > "$b" + echo "valgrind --gen-suppressions=all --quiet --error-exitcode=1 --suppressions=${BASE_ROOT_DIR}/contrib/valgrind.supp \"${b}_orig\" \"\$@\"" >> "$b" + chmod +x "$b" + done +done diff --git a/contrib/containers/ci/Dockerfile b/contrib/containers/ci/Dockerfile index b74b9466a97f1..f07a79699323c 100644 --- a/contrib/containers/ci/Dockerfile +++ b/contrib/containers/ci/Dockerfile @@ -74,6 +74,7 @@ RUN apt-get update && apt-get install $APT_ARGS \ nsis \ python3-zmq \ parallel \ + valgrind \ wine-stable \ wine32 \ wine64 \ diff --git a/contrib/valgrind.supp b/contrib/valgrind.supp index 06df5636b5844..d2c904743d44e 100644 --- a/contrib/valgrind.supp +++ b/contrib/valgrind.supp @@ -1,7 +1,5 @@ -# Valgrind suppressions file for Dash. -# -# Includes known Valgrind warnings in our dependencies that cannot be fixed -# in-tree. +# This valgrind suppressions file includes known Valgrind warnings in our +# dependencies that cannot be fixed in-tree. # # Example use: # $ valgrind --suppressions=contrib/valgrind.supp src/test/test_dash @@ -14,6 +12,9 @@ # --error-limit=no src/test/test_dash # # Note that suppressions may depend on OS and/or library versions. +# Tested on: +# * aarch64 (Ubuntu 20.04 system libs, without gui) +# * x86_64 (Ubuntu 18.04 system libs, without gui) { Suppress libstdc++ warning - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65434 Memcheck:Leak @@ -30,8 +31,6 @@ Memcheck:Cond obj:*/libdb_cxx-*.so fun:__log_put - obj:*/libdb_cxx-*.so - fun:__log_put_record } { Suppress libdb warning @@ -39,8 +38,50 @@ pwrite64(buf) fun:pwrite fun:__os_io +} +{ + Suppress libdb warning + Memcheck:Cond + fun:__log_putr.isra.1 +} +{ + Suppress libdb warning + Memcheck:Param + pwrite64(buf) + ... + obj:*/libdb_cxx-*.so +} +{ + Suppress uninitialized bytes warning in compat code + Memcheck:Param + ioctl(TCSET{S,SW,SF}) + fun:tcsetattr +} +{ + Suppress libdb warning + Memcheck:Leak + fun:malloc + ... obj:*/libdb_cxx-*.so } +{ + Suppress leaks on init + Memcheck:Leak + ... + fun:_Z11AppInitMainR11NodeContext +} +{ + Suppress leaks on shutdown + Memcheck:Leak + ... + fun:_Z8ShutdownR11NodeContext +} +{ + Ignore GUI warning + Memcheck:Leak + ... + obj:/usr/lib64/libgdk-3.so.0.2404.7 +} { Suppress leveldb warning (leveldb::InitModule()) - https://github.com/google/leveldb/issues/113 Memcheck:Leak @@ -56,17 +97,48 @@ ... fun:_ZN7leveldbL14InitDefaultEnvEv } +{ + Suppress leveldb leak + Memcheck:Leak + match-leak-kinds: reachable + fun:_Znwm + ... + fun:_ZN7leveldb6DBImpl14BackgroundCallEv +} +{ + Suppress leveldb leak + Memcheck:Leak + fun:_Znwm + ... + fun:GetCoin +} { Suppress wcsnrtombs glibc SSE4 warning (could be related: https://stroika.atlassian.net/browse/STK-626) Memcheck:Addr16 fun:__wcsnlen_sse4_1 fun:wcsnrtombs } +{ + Suppress wcsnrtombs warning (remove after removing boost::fs) + Memcheck:Cond + ... + fun:_ZN5boost10filesystem6detail11unique_pathERKNS0_4pathEPNS_6system10error_codeE +} +{ + Suppress boost warning + Memcheck:Leak + fun:_Znwm + ... + fun:_ZN5boost9unit_test9framework5state17execute_test_treeEmjPKNS2_23random_generator_helperE + fun:_ZN5boost9unit_test9framework3runEmb + fun:_ZN5boost9unit_test14unit_test_mainEPFbvEiPPc + fun:main +} { Suppress boost::filesystem warning (fixed in boost 1.70: https://github.com/boostorg/filesystem/commit/bbe9d1771e5d679b3f10c42a58fc81f7e8c024a9) Memcheck:Cond fun:_ZN5boost10filesystem6detail28directory_iterator_incrementERNS0_18directory_iteratorEPNS_6system10error_codeE - fun:_ZN5boost10filesystem6detail28directory_iterator_constructERNS0_18directory_iteratorERKNS0_4pathEPNS_6system10error_codeE + ... obj:*/libboost_filesystem.so.* } { @@ -74,6 +146,7 @@ Memcheck:Leak match-leak-kinds: reachable fun:_Znwm + ... fun:_ZN5boost10filesystem8absoluteERKNS0_4pathES3_ } { diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index b1afeacc13d90..d4e4ff99e01ad 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -795,7 +795,9 @@ void RPCConsole::setFontSize(int newSize) { QSettings settings; - newSize = std::min(std::max(newSize, FONT_RANGE.width()), FONT_RANGE.height()); + //don't allow an insane font size + if (newSize < FONT_RANGE.width() || newSize > FONT_RANGE.height()) + return; // temp. store the console content QString str = ui->messagesWidget->toHtml(); diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 1c90414968bb6..00a86857c76ec 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -333,7 +333,7 @@ void TransactionView::chooseType(int idx) if(!transactionProxyModel) return; transactionProxyModel->setTypeFilter( - typeWidget->itemData(idx).toInt()); + typeWidget->itemData(idx).toUInt()); // Persist settings QSettings settings; settings.setValue("transactionType", idx); diff --git a/test/functional/feature_abortnode.py b/test/functional/feature_abortnode.py index 20304be8fd8f6..48d8ba3b918ec 100755 --- a/test/functional/feature_abortnode.py +++ b/test/functional/feature_abortnode.py @@ -14,11 +14,12 @@ from test_framework.util import wait_until, get_datadir_path import os -class AbortNodeTest(BitcoinTestFramework): +class AbortNodeTest(BitcoinTestFramework): def set_test_params(self): self.setup_clean_chain = True self.num_nodes = 2 + self.rpc_timeout = 240 def setup_network(self): self.setup_nodes() @@ -44,5 +45,6 @@ def run_test(self): self.log.info("Node crashed - now verifying restart fails") self.nodes[0].assert_start_raises_init_error() + if __name__ == '__main__': AbortNodeTest().main() diff --git a/test/functional/feature_block.py b/test/functional/feature_block.py index c41bd5a10f82b..4182dc16f4c34 100755 --- a/test/functional/feature_block.py +++ b/test/functional/feature_block.py @@ -1272,7 +1272,7 @@ def run_test(self): self.save_spendable_output() spend = self.get_spendable_output() - self.send_blocks(blocks, True, timeout=1920) + self.send_blocks(blocks, True, timeout=2440) chain1_tip = i # now create alt chain of same length @@ -1284,14 +1284,14 @@ def run_test(self): # extend alt chain to trigger re-org block = self.next_block("alt" + str(chain1_tip + 1), version=4) - self.send_blocks([block], True, timeout=1920) + self.send_blocks([block], True, timeout=2440) # ... and re-org back to the first chain self.move_tip(chain1_tip) block = self.next_block(chain1_tip + 1, version=4) self.send_blocks([block], False, force_send=True) block = self.next_block(chain1_tip + 2, version=4) - self.send_blocks([block], True, timeout=1920) + self.send_blocks([block], True, timeout=2440) self.log.info("Reject a block with an invalid block header version") b_v1 = self.next_block('b_v1', version=1) diff --git a/test/functional/feature_cltv.py b/test/functional/feature_cltv.py index 82969347fb085..c9e872b377fd2 100755 --- a/test/functional/feature_cltv.py +++ b/test/functional/feature_cltv.py @@ -62,7 +62,7 @@ def set_test_params(self): '-acceptnonstdtxn=1', # cltv_invalidate is nonstandard ]] self.setup_clean_chain = True - self.rpc_timeout = 120 + self.rpc_timeout = 480 def test_cltv_info(self, *, is_active): assert_equal(self.nodes[0].getblockchaininfo()['softforks']['bip65'], diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py index 9ed602f6bf45c..f2ce574dc72b1 100755 --- a/test/functional/test_runner.py +++ b/test/functional/test_runner.py @@ -19,9 +19,8 @@ import os import time import shutil -import signal -import sys import subprocess +import sys import tempfile import re import logging @@ -416,11 +415,10 @@ def main(): args=passon_args, combined_logs_len=args.combinedlogslen, failfast=args.failfast, - runs_ci=args.ci, use_term_control=args.ansi, ) -def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, attempts=1, enable_coverage=False, args=None, combined_logs_len=0,failfast=False, runs_ci=False, use_term_control): +def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, attempts=1, enable_coverage=False, args=None, combined_logs_len=0,failfast=False, use_term_control): args = args or [] # Warn if dashd is already running @@ -473,7 +471,6 @@ def run_tests(*, test_list, src_dir, build_dir, tmpdir, jobs=1, attempts=1, enab tmpdir=tmpdir, test_list=test_list, flags=flags, - timeout_duration= 90 * 60 if runs_ci else float('inf'), # in seconds use_term_control=use_term_control, attempts=attempts, ) @@ -559,12 +556,11 @@ class TestHandler: Trigger the test scripts passed in via the list. """ - def __init__(self, *, num_tests_parallel, tests_dir, tmpdir, test_list, flags, timeout_duration, use_term_control, attempts): + def __init__(self, *, num_tests_parallel, tests_dir, tmpdir, test_list, flags, use_term_control, attempts): assert num_tests_parallel >= 1 self.num_jobs = num_tests_parallel self.tests_dir = tests_dir self.tmpdir = tmpdir - self.timeout_duration = timeout_duration self.test_list = test_list self.flags = flags self.num_running = 0 @@ -608,10 +604,6 @@ def get_next(self): time.sleep(.5) for job in self.jobs: (name, start_time, proc, testdir, log_out, log_err, portseed, attempt) = job - if int(time.time() - start_time) > self.timeout_duration: - # Timeout individual tests if timeout is specified (to stop - # tests hanging and not providing useful output). - proc.send_signal(signal.SIGINT) if proc.poll() is not None: log_out.seek(0), log_err.seek(0) [stdout, stderr] = [log_file.read().decode('utf-8') for log_file in (log_out, log_err)] diff --git a/test/functional/wallet_createwallet.py b/test/functional/wallet_createwallet.py index 66fb965cd2856..df1d9082e22ca 100755 --- a/test/functional/wallet_createwallet.py +++ b/test/functional/wallet_createwallet.py @@ -79,7 +79,7 @@ def run_test(self): assert_raises_rpc_error(-4, "Error: This wallet has no available keys", w4.getnewaddress) assert_raises_rpc_error(-4, "Error: This wallet has no available keys", w4.getrawchangeaddress) # Now set a seed and it should work. Wallet should also be encrypted - w4.walletpassphrase('pass', 2) + w4.walletpassphrase('pass', 60) w4.upgradetohd(walletpassphrase='pass') w4.getnewaddress() w4.getrawchangeaddress() diff --git a/test/sanitizer_suppressions/ubsan b/test/sanitizer_suppressions/ubsan index 2232bebc7430e..d69e3e8af8960 100644 --- a/test/sanitizer_suppressions/ubsan +++ b/test/sanitizer_suppressions/ubsan @@ -48,6 +48,7 @@ implicit-integer-sign-change:chain.* implicit-integer-sign-change:coins.h implicit-integer-sign-change:compat/stdin.cpp implicit-integer-sign-change:compressor.h +implicit-integer-sign-change:crc32c/ implicit-integer-sign-change:crypto/* implicit-integer-sign-change:key.cpp implicit-integer-sign-change:noui.cpp