Skip to content

Commit fb4f047

Browse files
committed
Merge bitcoin/bitcoin#27724: build: disable boost multi index safe mode in debug mode
59c8944 build: disable boost multi index safe mode (willcl-ark) Pull request description: Fixes #27586 Disable boost multi index safe mode by default when configuring with --enable-debug. This option can cause transactions to take a long time to be accepted into the mempool under certain conditions; iterator destruction takes O(n) time vs O(1) as they are stored in a singly linked list. See 27586 and the [boost docs](https://www.boost.org/doc/libs/1_58_0/boost/multi_index/detail/safe_mode.hpp) for more information. Re-enable it on the CI builds which previously had it enabled. Re-enable it on the msan fuzz task so that we have fuzz tasks testing with it enabled and disabled in this repo. ACKs for top commit: hebasto: ~ACK 59c8944~ fanquake: ACK 59c8944 Tree-SHA512: ed654f63dbebdd02e4414d1f81147d92a4d490dbb5a2e0376858e3129097645f3a2df45191d6b40c410a76e803b0d28796d1a01c1d2fd995b94e8b7eb3949027
2 parents dfe6580 + 59c8944 commit fb4f047

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

ci/test/00_setup_env_i686_multiprocess.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export CI_IMAGE_NAME_TAG=ubuntu:20.04
1212
export PACKAGES="cmake python3 llvm clang g++-multilib"
1313
export DEP_OPTS="DEBUG=1 MULTIPROCESS=1"
1414
export GOAL="install"
15-
export BITCOIN_CONFIG="--enable-debug CC='clang -m32' CXX='clang++ -m32' LDFLAGS='--rtlib=compiler-rt -lgcc_s'"
15+
export BITCOIN_CONFIG="--enable-debug CC='clang -m32' CXX='clang++ -m32' \
16+
LDFLAGS='--rtlib=compiler-rt -lgcc_s' CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE'"
1617
export TEST_RUNNER_ENV="BITCOIND=bitcoin-node"
1718
export TEST_RUNNER_EXTRA="--nosandbox"

ci/test/00_setup_env_native_fuzz_with_msan.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export PACKAGES="clang-16 llvm-16 libclang-rt-16-dev cmake"
1717
# BDB generates false-positives and will be removed in future
1818
export DEP_OPTS="NO_BDB=1 NO_QT=1 CC='clang' CXX='clang++' CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'"
1919
export GOAL="install"
20-
export BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer,memory --disable-hardening --with-asm=no CC=clang CXX=clang++ CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'"
20+
export BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer,memory --disable-hardening --with-asm=no CC=clang CXX=clang++ CFLAGS='${MSAN_FLAGS}' CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'"
2121
export USE_MEMORY_SANITIZER="true"
2222
export RUN_UNIT_TESTS="false"
2323
export RUN_FUNCTIONAL_TESTS="false"

ci/test/00_setup_env_native_qt5.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ export RUN_UNIT_TESTS="false"
1717
export GOAL="install"
1818
export NO_WERROR=1 # -Werror=maybe-uninitialized
1919
export DOWNLOAD_PREVIOUS_RELEASES="true"
20-
export BITCOIN_CONFIG="--enable-zmq --with-libs=no --with-gui=qt5 --enable-reduce-exports \
21-
--enable-debug CFLAGS=\"-g0 -O2 -funsigned-char\" CXXFLAGS=\"-g0 -O2 -funsigned-char\""
20+
export BITCOIN_CONFIG="--enable-zmq --with-libs=no --with-gui=qt5 --enable-reduce-exports --enable-debug \
21+
CFLAGS=\"-g0 -O2 -funsigned-char\" CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE' CXXFLAGS=\"-g0 -O2 -funsigned-char\""

configure.ac

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,10 +1491,6 @@ if test "$use_boost" = "yes"; then
14911491
AX_CHECK_PREPROC_FLAG([-DBOOST_NO_CXX98_FUNCTION_BASE], [BOOST_CPPFLAGS="$BOOST_CPPFLAGS -DBOOST_NO_CXX98_FUNCTION_BASE"], [], [$CXXFLAG_WERROR],
14921492
[AC_LANG_PROGRAM([[#include <boost/config.hpp>]])])
14931493

1494-
if test "$enable_debug" = "yes" || test "$enable_fuzz" = "yes"; then
1495-
BOOST_CPPFLAGS="$BOOST_CPPFLAGS -DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE"
1496-
fi
1497-
14981494
if test "$suppress_external_warnings" != "no"; then
14991495
BOOST_CPPFLAGS=SUPPRESS_WARNINGS($BOOST_CPPFLAGS)
15001496
fi

0 commit comments

Comments
 (0)