0# clang++ --version
1clang version 20.1.8 (Fedora 20.1.8-1.fc43)
2Target: aarch64-redhat-linux-gnu
3
4make -C depends/ NO_QT=1 NO_ZMQ=1 NO_USDT=1 NO_WALLET=1 NO_IPC=1 AR=llvm-ar NM=llvm-nm RANLIB=llvm-ranlib STRIP=llvm-strip LDFLAGS="-fuse-ld=lld" CC=clang CXX=clang++
5cmake -B build --toolchain /root/bitcoin/depends/aarch64-unknown-linux-gnu/toolchain.cmake -DBUILD_FOR_FUZZING=ON -DSANITIZERS=address -DAPPEND_CFLAGS="-flto=full" -DAPPEND_CXXFLAGS="-flto=full" -DAPPEND_LDFLAGS="-flto=full"
6cmake --build build
0./build/bin/fuzz
1=================================================================
2==987273==ERROR: AddressSanitizer: odr-violation (0xab71fdf737c0):
3 [1] size=19 'typeinfo name for CCoinsViewBacked' /root/bitcoin/src/coins.cpp in /root/bitcoin/build/bin/fuzz
4 [2] size=19 'typeinfo name for CCoinsViewBacked' /root/bitcoin/src/coins.cpp in /root/bitcoin/build/bin/fuzz
5These globals were registered at these points:
6 [1]:
7 [#0](/bitcoin-bitcoin/0/) 0xab71fcd09e3c in __asan_register_globals (/root/bitcoin/build/bin/fuzz+0x2d9e3c) (BuildId: f2dc106e95ba2dafe63dc7170e17e7f0baf3ce0a)
8 [#1](/bitcoin-bitcoin/1/) 0xab71fcd0aef4 in __asan_register_elf_globals (/root/bitcoin/build/bin/fuzz+0x2daef4) (BuildId: f2dc106e95ba2dafe63dc7170e17e7f0baf3ce0a)
9 [#2](/bitcoin-bitcoin/2/) 0xab71fccf64ac in _start (/root/bitcoin/build/bin/fuzz+0x2c64ac) (BuildId: f2dc106e95ba2dafe63dc7170e17e7f0baf3ce0a)
10
11 [2]:
12 [#0](/bitcoin-bitcoin/0/) 0xab71fcd09e3c in __asan_register_globals (/root/bitcoin/build/bin/fuzz+0x2d9e3c) (BuildId: f2dc106e95ba2dafe63dc7170e17e7f0baf3ce0a)
13 [#1](/bitcoin-bitcoin/1/) 0xab71fcd0aef4 in __asan_register_elf_globals (/root/bitcoin/build/bin/fuzz+0x2daef4) (BuildId: f2dc106e95ba2dafe63dc7170e17e7f0baf3ce0a)
14 [#2](/bitcoin-bitcoin/2/) 0xab71fccf64ac in _start (/root/bitcoin/build/bin/fuzz+0x2c64ac) (BuildId: f2dc106e95ba2dafe63dc7170e17e7f0baf3ce0a)
15
16==987273==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
17SUMMARY: AddressSanitizer: odr-violation: global 'typeinfo name for CCoinsViewBacked' at /root/bitcoin/src/coins.cpp in /root/bitcoin/build/bin/fuzz
18==987273==ABORTING
Noticed while retrying -flto with oss-fuzz. Saw something similar there, under -O1:
0[100%] Built target fuzz
1+ WRITE_ALL_FUZZ_TARGETS_AND_ABORT=/tmp/a
2+ ./build_fuzz/bin/fuzz
3=================================================================
4==8668==ERROR: AddressSanitizer: odr-violation (0x55c825a8e0a0):
5 [1] size=20 'typeinfo name for leveldb::Snapshot' /src/bitcoin-core/src/leveldb/db/db_impl.cc in /src/bitcoin-core/build_fuzz/bin/fuzz
6 [2] size=20 'typeinfo name for leveldb::Snapshot' /src/bitcoin-core/src/leveldb/db/db_impl.cc in /src/bitcoin-core/build_fuzz/bin/fuzz
7These globals were registered at these points:
8 [1]:
9 [#0](/bitcoin-bitcoin/0/) 0x55c82338e5a6 in __asan_register_globals /src/llvm-project/compiler-rt/lib/asan/asan_globals.cpp:369:3
10 [#1](/bitcoin-bitcoin/1/) 0x55c82338f6c9 in __asan_register_elf_globals /src/llvm-project/compiler-rt/lib/asan/asan_globals.cpp:352:3
11 [#2](/bitcoin-bitcoin/2/) 0x55c8255c24ec in __libc_csu_init (/src/bitcoin-core/build_fuzz/bin/fuzz+0x32724ec)
12
13 [2]:
14 [#0](/bitcoin-bitcoin/0/) 0x55c82338e5a6 in __asan_register_globals /src/llvm-project/compiler-rt/lib/asan/asan_globals.cpp:369:3
15 [#1](/bitcoin-bitcoin/1/) 0x55c82338f6c9 in __asan_register_elf_globals /src/llvm-project/compiler-rt/lib/asan/asan_globals.cpp:352:3
16 [#2](/bitcoin-bitcoin/2/) 0x55c8255c24ec in __libc_csu_init (/src/bitcoin-core/build_fuzz/bin/fuzz+0x32724ec)
17
18==8668==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
19SUMMARY: AddressSanitizer: odr-violation: global 'typeinfo name for leveldb::Snapshot' at /src/bitcoin-core/src/leveldb/db/db_impl.cc in /src/bitcoin-core/build_fuzz/bin/fuzz
20==8668==ABORTING