Skip to content

oss-fuzz: coins_view_overlay: ASSERT: m_dirty_count == 0 #34645

Closed

Description

@fanquake

https://issues.oss-fuzz.com/issues/486389268

Command: /mnt/scratch0/clusterfuzz/resources/platform/linux/unshare -c -n /mnt/scratch0/clusterfuzz/bot/builds/clusterfuzz-builds_bitcoin-core_83aef6625aaeafa301867de74608b320f3c923fe/revisions/coins_view_overlay -rss_limit_mb=2560 -timeout=60 -runs=100 /mnt/scratch0/clusterfuzz/bot/inputs/fuzzer-testcases/crash-e84f31ab73616c1a282fb40ce4e33abd394fb911
	Time ran: 0.49608683586120605
	
	INFO: Running with entropic power schedule (0xFF, 100).
	INFO: Seed: 360939801
	INFO: Loaded 1 modules   (603691 inline 8-bit counters): 603691 [0x55a793000eb0, 0x55a7930944db),
	INFO: Loaded 1 PC tables (603691 PCs): 603691 [0x55a7930944e0,0x55a7939ca790),
	/mnt/scratch0/clusterfuzz/bot/builds/clusterfuzz-builds_bitcoin-core_83aef6625aaeafa301867de74608b320f3c923fe/revisions/coins_view_overlay: Running 1 inputs 100 time(s) each.
	Running: /mnt/scratch0/clusterfuzz/bot/inputs/fuzzer-testcases/crash-e84f31ab73616c1a282fb40ce4e33abd394fb911
	coins.cpp:283 void CCoinsViewCache::Flush(bool): Assertion `m_dirty_count == 0` failed.
	==241== ERROR: libFuzzer: deadly signal
	    #0 0x55a7909aa551 in __sanitizer_print_stack_trace /src/llvm-project/compiler-rt/lib/asan/asan_stack.cpp:87:3
	    #1 0x55a79089bff8 in fuzzer::PrintStackTrace() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerUtil.cpp:210:5
	    #2 0x55a79087eb45 in fuzzer::Fuzzer::CrashCallback() /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:231:3
	    #3 0x7f08d19c041f in libpthread.so.0
	    #4 0x7f08d17b400a in __libc_signal_restore_set /build/glibc-B3wQXB/glibc-2.31/sysdeps/unix/sysv/linux/internal-signals.h:86:3
	    #5 0x7f08d17b400a in raise /build/glibc-B3wQXB/glibc-2.31/sysdeps/unix/sysv/linux/raise.c:48:3
	    #6 0x7f08d1793858 in abort /build/glibc-B3wQXB/glibc-2.31/stdlib/abort.c:79:7
	    #7 0x55a7915cc5e2 in assertion_fail(std::__1::source_location const&, std::__1::basic_string_view<char, std::__1::char_traits<char>>) [bitcoin-core/src/util/check.cpp:41](https://github.com/bitcoin/bitcoin/blob/ee2065fdeaca91caaad9eb7daeeffe939441d804/src/util/check.cpp#L41):5
	    #8 0x55a79128c7ea in inline_assertion_check<false, bool> [bitcoin-core/src/util/check.h:90](https://github.com/bitcoin/bitcoin/blob/ee2065fdeaca91caaad9eb7daeeffe939441d804/src/util/check.h#L90):13
	    #9 0x55a79128c7ea in CCoinsViewCache::Flush(bool) [bitcoin-core/src/coins.cpp:283](https://github.com/bitcoin/bitcoin/blob/ee2065fdeaca91caaad9eb7daeeffe939441d804/src/coins.cpp#L283):5
	    #10 0x55a790c4dea7 in operator() [bitcoin-core/src/test/fuzz/coins_view.cpp:135](https://github.com/bitcoin/bitcoin/blob/ee2065fdeaca91caaad9eb7daeeffe939441d804/src/test/fuzz/coins_view.cpp#L135):34
	    #11 0x55a790c4dea7 in CallOneOf<(lambda at /src/bitcoin-core/src/test/fuzz/coins_view.cpp:116:13), (lambda at /src/bitcoin-core/src/test/fuzz/coins_view.cpp:134:13), (lambda at /src/bitcoin-core/src/test/fuzz/coins_view.cpp:137:13), (lambda at /src/bitcoin-core/src/test/fuzz/coins_view.cpp:140:13), (lambda at /src/bitcoin-core/src/test/fuzz/coins_view.cpp:146:13), (lambda at /src/bitcoin-core/src/test/fuzz/coins_view.cpp:160:13), (lambda at /src/bitcoin-core/src/test/fuzz/coins_view.cpp:164:13), (lambda at /src/bitcoin-core/src/test/fuzz/coins_view.cpp:167:13), (lambda at /src/bitcoin-core/src/test/fuzz/coins_view.cpp:173:13), (lambda at /src/bitcoin-core/src/test/fuzz/coins_view.cpp:181:13), (lambda at /src/bitcoin-core/src/test/fuzz/coins_view.cpp:189:13), (lambda at /src/bitcoin-core/src/test/fuzz/coins_view.cpp:197:13)> [bitcoin-core/src/test/fuzz/util.h:42](https://github.com/bitcoin/bitcoin/blob/ee2065fdeaca91caaad9eb7daeeffe939441d804/src/test/fuzz/util.h#L42):27
	    #12 0x55a790c4dea7 in TestCoinsView(FuzzedDataProvider&, CCoinsViewCache&, CCoinsView&, bool) [bitcoin-core/src/test/fuzz/coins_view.cpp:114](https://github.com/bitcoin/bitcoin/blob/ee2065fdeaca91caaad9eb7daeeffe939441d804/src/test/fuzz/coins_view.cpp#L114):9
	    #13 0x55a790c4c486 in coins_view_overlay_fuzz_target(std::__1::span<unsigned char const, 18446744073709551615ul>) [bitcoin-core/src/test/fuzz/coins_view.cpp:404](https://github.com/bitcoin/bitcoin/blob/ee2065fdeaca91caaad9eb7daeeffe939441d804/src/test/fuzz/coins_view.cpp#L404):5
	    #14 0x55a7912282f4 in operator() /usr/local/include/c++/v1/__functional/function.h:274:12
	    #15 0x55a7912282f4 in operator() /usr/local/include/c++/v1/__functional/function.h:772:10
	    #16 0x55a7912282f4 in test_one_input [bitcoin-core/src/test/fuzz/fuzz.cpp:88](https://github.com/bitcoin/bitcoin/blob/ee2065fdeaca91caaad9eb7daeeffe939441d804/src/test/fuzz/fuzz.cpp#L88):5
	    #17 0x55a7912282f4 in LLVMFuzzerTestOneInput [bitcoin-core/src/test/fuzz/fuzz.cpp:216](https://github.com/bitcoin/bitcoin/blob/ee2065fdeaca91caaad9eb7daeeffe939441d804/src/test/fuzz/fuzz.cpp#L216):5
	    #18 0x55a79088022d in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:619:13
	    #19 0x55a790869f42 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:329:6
	    #20 0x55a79086fe10 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:865:9
	    #21 0x55a79089c9a2 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
	    #22 0x7f08d1795082 in __libc_start_main /build/glibc-B3wQXB/glibc-2.31/csu/libc-start.c:308:16
	    #23 0x55a79086302d in _start
	
	NOTE: libFuzzer has rudimentary signal handlers.
	      Combine libFuzzer with AddressSanitizer or similar for better crash reports.
	SUMMARY: libFuzzer: deadly signal

Activity

  1. added this to the 31.0 milestone on Feb 21, 2026
  2. fanquake commented on Feb 21, 2026

    @fanquake
    MemberAuthor
  3. sipa commented on Feb 21, 2026

    @sipa
    Member

    FWIW:

    $ base64 <clusterfuzz-testcase-minimized-coins_view_overlay-6749085850992640 
    ICAJICAgXCDpeunp6enp6enp6enp6enp6enp6enp6enp6enp6eDp6enp6elcICAgICAgICAgICAg
    ICAgICAgICAgICAgICAgICAgICAgICAgIFwg6Xrp6enp6enp6enp6enp6enp6enp6enp6enp6eng
    6enp6enpXCDl/yD/MP8g/yD/MP8g5f8g/yD/MP8g/13/
    

    And indeed, looks like it is fixed by #33018.

    EDIT: this seems coincidental; 33018 doesn't address the root cause.

  4. sipa commented on Feb 21, 2026

    @sipa
    Member

    However, after merging 33018, the following seed fails FUZZ=coins_view_overlay (which does not fail on master). This is with a very hastily-created merge as there were some conflicts, it is possible I introduced a bug when merging.

    Tc8pCSCAAeUKAAAAAAAAAFxTAAAAAA4AAAD/U1MBAAAAAAAAaFNT8VNT8VOs//v///9B/7S0tIv/
    tLRdtKN////f/////uDg/6kAdR/gAAD///////8hAAAAAAAAAAAFBQ3l2AmLXFNTU1NTPprxQfFT
    U1OnrFP/mQEnXF1dXV1dXV1dXV1dXV1TAAAAAA4AAAD/U1MBAAAAAAAAaFNTrFNT//////8FBQUA
    BQUNAQAAAAAAgAHlCv////////8BBf///////6xTU///////BQAFBQUFDQEAAAAAAIAB5QoAAAAA
    AAAAXFMAAAAADgAAAP9TUwEAAAAAAABoU1PxU1PxU6z/+////0H/tLS0i/+0tF20o3///9/////+
    4OD/qQB1H+AAAP///////yEAAAAAAAAAAAUFDeXYCVxTU1NTUz6a8UHxU1MBAAAAAAAAaFNT////
    ///74AAA////////IQAAAAAAAAUAAOUF2A0JXFNTU1NTPprxQfFTU1OnrFP///8h////////BQAF
    BQUFDQEAAAAAAIAB5QoAAAAAAAAADSdcUwBTU1NTU1OsUxkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZ
    GRkZGRkZGRkZGRkZGRkZGRk6GRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRgZGRkZGRkZGRkZGRlT
    U/HxQfHs8SsjDPGZr/Hs+SsjDPGZrw0nXFMAU1NTU1NTrFNTU/HxQarx7PE/KyMM8Zmv8ew/KyMM
    8Zmv
    
  5. andrewtoth commented on Feb 21, 2026

    @andrewtoth
    Contributor
  6. sipa commented on Feb 21, 2026

    @sipa
    Member

    Looks like it's the result of the combination of #33512 and #34165, and ultimately a bug in the fuzz test, not the code being tested.

  7. andrewtoth commented on Feb 22, 2026

    @andrewtoth
    Contributor

    Previously double iterating cursor entries was safe, but after #33512 we are decrementing m_dirty_count which can't be done twice.

  8. added a commit that references this issue on Feb 24, 2026
    76eb04b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions