aboutsummaryrefslogtreecommitdiff
path: root/ci/test/06_script_a.sh
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2020-06-01 08:12:33 +0000
committerpracticalswift <practicalswift@users.noreply.github.com>2020-06-23 09:09:30 +0000
commit870f0cd2a0534d54bba18190e9f024f88e832933 (patch)
treef54535816302eb6009f9d56012f4c621718a226c /ci/test/06_script_a.sh
parent80fd474e402bb003c3a427f1997eb649e69138ba (diff)
downloadbitcoin-870f0cd2a0534d54bba18190e9f024f88e832933.tar.xz
build: Add MemorySanitizer (MSan) in Travis to detect use of uninitialized memory
Diffstat (limited to 'ci/test/06_script_a.sh')
-rwxr-xr-xci/test/06_script_a.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/ci/test/06_script_a.sh b/ci/test/06_script_a.sh
index b68cd9d3f8..17d765b862 100755
--- a/ci/test/06_script_a.sh
+++ b/ci/test/06_script_a.sh
@@ -37,6 +37,14 @@ END_FOLD
set -o errtrace
trap 'DOCKER_EXEC "cat ${BASE_SCRATCH_DIR}/sanitizer-output/* 2> /dev/null"' ERR
+if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then
+ # MemorySanitizer (MSAN) does not support tracking memory initialization done by
+ # using the Linux getrandom syscall. Avoid using getrandom by undefining
+ # HAVE_SYS_GETRANDOM. See https://github.com/google/sanitizers/issues/852 for
+ # details.
+ DOCKER_EXEC 'grep -v HAVE_SYS_GETRANDOM src/config/bitcoin-config.h > src/config/bitcoin-config.h.tmp && mv src/config/bitcoin-config.h.tmp src/config/bitcoin-config.h'
+fi
+
BEGIN_FOLD build
DOCKER_EXEC make $MAKEJOBS $GOAL || ( echo "Build failure. Verbose build follows." && DOCKER_EXEC make $GOAL V=1 ; false )
END_FOLD