build: Add cov_fuzz target #18107

pull MarcoFalke wants to merge 3 commits into bitcoin:master from MarcoFalke:2002-buildCovFuzz changing 3 files +21 −6
  1. MarcoFalke commented at 1:40 PM on February 10, 2020: member

    Only libFuzzer is supported right now, so clang is required. Thus, this needs a workaround such as #12602 (comment)

    Can be tested with:

    mkdir build && cd build
    ../configure --enable-fuzz --with-sanitizers=fuzzer --enable-lcov --enable-lcov-branch-coverage CC=clang CXX=clang++
    make $MAKEJOBS
    make cov_fuzz
    
  2. build: Remove unused USE_COVERAGE faf2c5aca0
  3. build: link fuzz/test_runner.py for out-of-tree builds fac71e364e
  4. MarcoFalke added the label Build system on Feb 10, 2020
  5. build: Add cov_fuzz target faf7d4fa86
  6. MarcoFalke force-pushed on Feb 10, 2020
  7. practicalswift commented at 5:07 PM on February 10, 2020: contributor

    Strongest possible Concept ACK -- will test :)

    BTW, I noticed that the fuzzing coverage link is broken on your otherwise excellent coverage statistics page. Will the merge of this fix that? :)

  8. MarcoFalke commented at 5:10 PM on February 10, 2020: member

    Which link is broken? https://marcofalke.github.io/btc_cov/ ?

    Note that the fuzzers were running into a stack overflow, thus unable to produce a result. So for a while that page was a 404. This should now be fixed with 657c5e5f1cd92169b5a3c880f01376b7ed0fd9b3

  9. practicalswift commented at 5:11 PM on February 10, 2020: contributor

    @MarcoFalke Ah, then the issue was temporary. Cannot reproduce today :)

  10. MarcoFalke commented at 1:13 PM on March 12, 2020: member

    Strongest possible Concept ACK -- will test :) @practicalswift Are you still planning to test? :thinking:

  11. practicalswift commented at 3:51 PM on March 12, 2020: contributor

    @MarcoFalke Absolutely :)

    I ran in to some problems - see below.

    What versions of gcov, lcov and clang++ are you using? I'm using gcov 7.5.0, lcov 1.13 and clang++ 10.0.0.

    $ make distclean
    $ ./autogen.sh
    $ ./configure --enable-fuzz --with-sanitizers=fuzzer --enable-lcov --enable-lcov-branch-coverage CC=clang CXX=clang++
    $ make
    $ git clone https://github.com/bitcoin-core/qa-assets
    $ make cov_fuzz
    …
    
    Run uint256_deserialize with args ['…/src/test/fuzz/uint256_deserialize', '-runs=1', 'qa-assets/fuzz_seed_corpus/uint256_deserialize']
    Output: INFO: Seed: 1103855062
    INFO: Loaded 1 modules   (1032 inline 8-bit counters): 1032 [0x5624c7ccdb08, 0x5624c7ccdf10),
    INFO: Loaded 1 PC tables (1032 PCs): 1032 [0x5624c7ccdf10,0x5624c7cd1f90),
    INFO:        0 files found in qa-assets/fuzz_seed_corpus/uint256_deserialize
    INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes
    INFO: A corpus is not provided, starting from an empty corpus
    [#2](/bitcoin-bitcoin/2/)      INITED cov: 119 ft: 120 corp: 1/1b exec/s: 0 rss: 27Mb
    [#2](/bitcoin-bitcoin/2/)      DONE   cov: 119 ft: 120 corp: 1/1b lim: 4 exec/s: 0 rss: 27Mb
    Done 2 runs in 0 second(s)
    
    /usr/bin/lcov --gcov-tool=/usr/bin/gcov -c --rc lcov_branch_coverage=1 -d …/src --t fuzz-tests -o fuzz.info
    Capturing coverage data from …/src
    Found gcov version: 7.5.0
    geninfo: WARNING: invalid characters removed from testname!
    Scanning …/src for .gcda files ...
    Found 361 data files in …/src
    Processing src/libbitcoin_util_a-fs.gcda
    …/src/libbitcoin_util_a-fs.gcno:version '402*', prefer 'A75*'
    geninfo: ERROR: GCOV failed for …/src/libbitcoin_util_a-fs.gcda!
    Makefile:1321: recipe for target 'fuzz.info' failed
    make: *** [fuzz.info] Error 29
    rm baseline_filtered.info fuzz.info baseline.info
    $ lcov --version
    lcov: LCOV version 1.13
    $ gcov --version | head -1
    gcov (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
    $ clang++ --version | head -1
    clang version 10.0.0 (https://github.com/llvm/llvm-project.git f1b117394d7f9ae6decf9730ed9d443ca1b54769)
    
  12. MarcoFalke commented at 5:30 PM on March 12, 2020: member

    @practicalswift Have you applied the workaround? #12602 (comment)

  13. MarcoFalke commented at 5:32 PM on March 12, 2020: member

    Other than that I use vanilla debian:bullseye with whatever clang comes in there.

  14. practicalswift commented at 6:28 PM on March 12, 2020: contributor

    @MarcoFalke Thanks! Works as expected with workaround applied.

  15. practicalswift commented at 6:28 PM on March 12, 2020: contributor

    ACK faf7d4fa86b700ec272806cd2bd8666a92405619

  16. laanwj merged this on Mar 27, 2020
  17. laanwj closed this on Mar 27, 2020

  18. MarcoFalke deleted the branch on Mar 27, 2020
  19. sidhujag referenced this in commit 2c27c78eae on Mar 28, 2020
  20. MarcoFalke referenced this in commit e349eeeb2c on Aug 8, 2020
  21. sidhujag referenced this in commit 59cd04bdf5 on Aug 8, 2020
  22. PastaPastaPasta referenced this in commit 7c488f73f9 on Sep 17, 2021
  23. PastaPastaPasta referenced this in commit db62c6f314 on Sep 19, 2021
  24. thelazier referenced this in commit 586492d15a on Sep 25, 2021
  25. DrahtBot locked this on Feb 15, 2022

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-04-17 06:14 UTC

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