mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-12 11:19:08 -05:00
Merge bitcoin/bitcoin#28359: ci: Asan with -ftrivial-auto-var-init=pattern
fa07ac48d8
ci: Asan with -ftrivial-auto-var-init=pattern (MarcoFalke) Pull request description: This makes memory bugs deterministic. `-ftrivial-auto-var-init=pattern` is incompatible with other memory sanitizers (like valgrind and msan), but that is irrelevant here, because the address sanitizer in this fuzz CI config is already incompatible with them. `-ftrivial-auto-var-init=pattern` goes well with `-fsanitize=bool` and `-fsanitize=enum`, but those are already enabled via `-fsanitize=undefined`. See https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#available-checks ACKs for top commit: fanquake: ACKfa07ac48d8
- going to get back to fixing up the cxxflags usage in CI, but not a blocker here: Tree-SHA512: 2ea6c5128a9cd262bdd1b1475c7e1be23ce2c520fad05f6c2aace6c29e203573323c0564d272e25da35ad5ff46fde488a5eae1ed14d3349e793d14a5e2533fb1
This commit is contained in:
commit
260445bee8
2 changed files with 25 additions and 1 deletions
|
@ -22,4 +22,5 @@ export NO_DEPENDS=1
|
||||||
export GOAL="install"
|
export GOAL="install"
|
||||||
export BITCOIN_CONFIG="--enable-c++20 --enable-usdt --enable-zmq --with-incompatible-bdb --with-gui=qt5 \
|
export BITCOIN_CONFIG="--enable-c++20 --enable-usdt --enable-zmq --with-incompatible-bdb --with-gui=qt5 \
|
||||||
CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER' \
|
CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER' \
|
||||||
--with-sanitizers=address,float-divide-by-zero,integer,undefined CC=clang-16 CXX=clang++-16"
|
--with-sanitizers=address,float-divide-by-zero,integer,undefined \
|
||||||
|
CC='clang-16 -ftrivial-auto-var-init=pattern' CXX='clang++-16 -ftrivial-auto-var-init=pattern'"
|
||||||
|
|
|
@ -29,6 +29,29 @@ df -h
|
||||||
# Tests that run natively guess the host
|
# Tests that run natively guess the host
|
||||||
export HOST=${HOST:-$("$BASE_ROOT_DIR/depends/config.guess")}
|
export HOST=${HOST:-$("$BASE_ROOT_DIR/depends/config.guess")}
|
||||||
|
|
||||||
|
(
|
||||||
|
# compact->outputs[i].file_size is uninitialized memory, so reading it is UB.
|
||||||
|
# The statistic bytes_written is only used for logging, which is disabled in
|
||||||
|
# CI, so as a temporary minimal fix to work around UB and CI failures, leave
|
||||||
|
# bytes_written unmodified.
|
||||||
|
# See https://github.com/bitcoin/bitcoin/pull/28359#issuecomment-1698694748
|
||||||
|
echo 'diff --git a/src/leveldb/db/db_impl.cc b/src/leveldb/db/db_impl.cc
|
||||||
|
index 65e31724bc..f61b471953 100644
|
||||||
|
--- a/src/leveldb/db/db_impl.cc
|
||||||
|
+++ b/src/leveldb/db/db_impl.cc
|
||||||
|
@@ -1028,9 +1028,6 @@ Status DBImpl::DoCompactionWork(CompactionState* compact) {
|
||||||
|
stats.bytes_read += compact->compaction->input(which, i)->file_size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- for (size_t i = 0; i < compact->outputs.size(); i++) {
|
||||||
|
- stats.bytes_written += compact->outputs[i].file_size;
|
||||||
|
- }
|
||||||
|
|
||||||
|
mutex_.Lock();
|
||||||
|
stats_[compact->compaction->level() + 1].Add(stats);' | patch -p1
|
||||||
|
git diff
|
||||||
|
)
|
||||||
|
|
||||||
if [ "$RUN_FUZZ_TESTS" = "true" ]; then
|
if [ "$RUN_FUZZ_TESTS" = "true" ]; then
|
||||||
export DIR_FUZZ_IN=${DIR_QA_ASSETS}/fuzz_seed_corpus/
|
export DIR_FUZZ_IN=${DIR_QA_ASSETS}/fuzz_seed_corpus/
|
||||||
if [ ! -d "$DIR_FUZZ_IN" ]; then
|
if [ ! -d "$DIR_FUZZ_IN" ]; then
|
||||||
|
|
Loading…
Add table
Reference in a new issue