diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2020-06-01 08:12:33 +0000 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2020-06-23 09:09:30 +0000 |
commit | 870f0cd2a0534d54bba18190e9f024f88e832933 (patch) | |
tree | f54535816302eb6009f9d56012f4c621718a226c /ci/test/05_before_script.sh | |
parent | 80fd474e402bb003c3a427f1997eb649e69138ba (diff) | |
download | bitcoin-870f0cd2a0534d54bba18190e9f024f88e832933.tar.xz |
build: Add MemorySanitizer (MSan) in Travis to detect use of uninitialized memory
Diffstat (limited to 'ci/test/05_before_script.sh')
-rwxr-xr-x | ci/test/05_before_script.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ci/test/05_before_script.sh b/ci/test/05_before_script.sh index de33881419..057395eba6 100755 --- a/ci/test/05_before_script.sh +++ b/ci/test/05_before_script.sh @@ -21,6 +21,14 @@ OSX_SDK_PATH="${DEPENDS_DIR}/sdk-sources/${OSX_SDK_BASENAME}" if [ -n "$XCODE_VERSION" ] && [ ! -f "$OSX_SDK_PATH" ]; then curl --location --fail "${SDK_URL}/${OSX_SDK_BASENAME}" -o "$OSX_SDK_PATH" fi + +if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then + # Use BDB compiled using install_db4.sh script to work around linking issue when using BDB + # from depends. See https://github.com/bitcoin/bitcoin/pull/18288#discussion_r433189350 for + # details. + DOCKER_EXEC "contrib/install_db4.sh \$(pwd) --enable-umrw CC=clang CXX=clang++ CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'" +fi + if [ -n "$XCODE_VERSION" ] && [ -f "$OSX_SDK_PATH" ]; then DOCKER_EXEC tar -C "${DEPENDS_DIR}/SDKs" -xf "$OSX_SDK_PATH" fi |