fuzz: AddressSanitizer: odr-violation typeinfo name for CCoinsViewBacked #32995

issue fanquake opened this issue on July 16, 2025
  1. fanquake commented at 3:54 PM on July 16, 2025: member
    # clang++ --version
    clang version 20.1.8 (Fedora 20.1.8-1.fc43)
    Target: aarch64-redhat-linux-gnu
    
    make -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++
    cmake -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"
    cmake --build build
    
    ./build/bin/fuzz
    =================================================================
    ==987273==ERROR: AddressSanitizer: odr-violation (0xab71fdf737c0):
      [1] size=19 'typeinfo name for CCoinsViewBacked' /root/bitcoin/src/coins.cpp in /root/bitcoin/build/bin/fuzz
      [2] size=19 'typeinfo name for CCoinsViewBacked' /root/bitcoin/src/coins.cpp in /root/bitcoin/build/bin/fuzz
    These globals were registered at these points:
      [1]:
        [#0](/bitcoin-bitcoin/0/) 0xab71fcd09e3c in __asan_register_globals (/root/bitcoin/build/bin/fuzz+0x2d9e3c) (BuildId: f2dc106e95ba2dafe63dc7170e17e7f0baf3ce0a)
        [#1](/bitcoin-bitcoin/1/) 0xab71fcd0aef4 in __asan_register_elf_globals (/root/bitcoin/build/bin/fuzz+0x2daef4) (BuildId: f2dc106e95ba2dafe63dc7170e17e7f0baf3ce0a)
        [#2](/bitcoin-bitcoin/2/) 0xab71fccf64ac in _start (/root/bitcoin/build/bin/fuzz+0x2c64ac) (BuildId: f2dc106e95ba2dafe63dc7170e17e7f0baf3ce0a)
    
      [2]:
        [#0](/bitcoin-bitcoin/0/) 0xab71fcd09e3c in __asan_register_globals (/root/bitcoin/build/bin/fuzz+0x2d9e3c) (BuildId: f2dc106e95ba2dafe63dc7170e17e7f0baf3ce0a)
        [#1](/bitcoin-bitcoin/1/) 0xab71fcd0aef4 in __asan_register_elf_globals (/root/bitcoin/build/bin/fuzz+0x2daef4) (BuildId: f2dc106e95ba2dafe63dc7170e17e7f0baf3ce0a)
        [#2](/bitcoin-bitcoin/2/) 0xab71fccf64ac in _start (/root/bitcoin/build/bin/fuzz+0x2c64ac) (BuildId: f2dc106e95ba2dafe63dc7170e17e7f0baf3ce0a)
    
    ==987273==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
    SUMMARY: AddressSanitizer: odr-violation: global 'typeinfo name for CCoinsViewBacked' at /root/bitcoin/src/coins.cpp in /root/bitcoin/build/bin/fuzz
    ==987273==ABORTING
    

    Noticed while retrying -flto with oss-fuzz. Saw something similar there, under -O1:

    [100%] Built target fuzz
    + WRITE_ALL_FUZZ_TARGETS_AND_ABORT=/tmp/a
    + ./build_fuzz/bin/fuzz
    =================================================================
    ==8668==ERROR: AddressSanitizer: odr-violation (0x55c825a8e0a0):
      [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
      [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
    These globals were registered at these points:
      [1]:
        [#0](/bitcoin-bitcoin/0/) 0x55c82338e5a6 in __asan_register_globals /src/llvm-project/compiler-rt/lib/asan/asan_globals.cpp:369:3
        [#1](/bitcoin-bitcoin/1/) 0x55c82338f6c9 in __asan_register_elf_globals /src/llvm-project/compiler-rt/lib/asan/asan_globals.cpp:352:3
        [#2](/bitcoin-bitcoin/2/) 0x55c8255c24ec in __libc_csu_init (/src/bitcoin-core/build_fuzz/bin/fuzz+0x32724ec)
    
      [2]:
        [#0](/bitcoin-bitcoin/0/) 0x55c82338e5a6 in __asan_register_globals /src/llvm-project/compiler-rt/lib/asan/asan_globals.cpp:369:3
        [#1](/bitcoin-bitcoin/1/) 0x55c82338f6c9 in __asan_register_elf_globals /src/llvm-project/compiler-rt/lib/asan/asan_globals.cpp:352:3
        [#2](/bitcoin-bitcoin/2/) 0x55c8255c24ec in __libc_csu_init (/src/bitcoin-core/build_fuzz/bin/fuzz+0x32724ec)
    
    ==8668==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
    SUMMARY: 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
    ==8668==ABORTING
    
  2. fanquake commented at 10:34 AM on November 10, 2025: member

    This was either solved @ 21.1.x or user error.

  3. fanquake closed this on Nov 10, 2025

  4. maflcko added the label Fuzzing on Nov 10, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-02 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me