tests: Add fuzzing harness for Golomb-Rice coding (GolombRiceEncode/GolombRiceDecode) #18190

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:fuzzers-golomb-rice changing 5 files +164 −31
  1. practicalswift commented at 4:01 PM on February 21, 2020: contributor

    Add fuzzing harness for Golomb-Rice coding (GolombRiceEncode/GolombRiceDecode).

    Test this PR using:

    $ make distclean
    $ ./autogen.sh
    $ CC=clang CXX=clang++ ./configure --enable-fuzz \
          --with-sanitizers=address,fuzzer,undefined
    $ make
    $ src/test/fuzz/golomb_rice
    …
    
  2. practicalswift force-pushed on Feb 21, 2020
  3. practicalswift requested review from jimpo on Feb 21, 2020
  4. DrahtBot commented at 5:27 PM on February 21, 2020: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #18432 (util: Make our stringstream usage locale independent by practicalswift)
    • #9245 (Drop IO priority to idle while reading blocks for peer requests and startup verification by luke-jr)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  5. DrahtBot added the label Build system on Feb 21, 2020
  6. DrahtBot added the label Tests on Feb 21, 2020
  7. practicalswift force-pushed on Feb 23, 2020
  8. practicalswift force-pushed on Feb 23, 2020
  9. practicalswift force-pushed on Feb 23, 2020
  10. practicalswift force-pushed on Feb 26, 2020
  11. in src/blockfilter.h:179 in 5b4391abfc outdated
     174 | +{
     175 | +    // Write quotient as unary-encoded: q 1's followed by one 0.
     176 | +    uint64_t q = x >> P;
     177 | +    while (q > 0) {
     178 | +        int nbits = q <= 64 ? static_cast<int>(q) : 64;
     179 | +        bitwriter.Write(~0ULL, nbits);
    


    jeandudey commented at 6:00 PM on February 27, 2020:

    It might not be seeing the obvious (and I know this PR doesn't touches this), but what's the point of ~0ULL? Seems confusing at a first glance.

            bitwriter.Write(0xFFFFFFFFFFFFFFFFULL, nbits);
    

    practicalswift commented at 6:24 PM on February 27, 2020:

    Yes, I agree that ~0 feels non-idiomatic. Personally I prefer std::numeric_limits<uint64_t>::max() :)

    But as you note this PR does not touch that code -- it only moves it. Thus leaving the comment without action.

  12. in src/blockfilter.h:16 in 5b4391abfc outdated
      12 | @@ -13,6 +13,7 @@
      13 |  
      14 |  #include <primitives/block.h>
      15 |  #include <serialize.h>
      16 | +#include <streams.h>
    


    laanwj commented at 3:39 PM on March 5, 2020:

    I don't really like moving these functions to the public interface of blockfilter and adding the stream.h header dependency here. Maybe move this to a new header that is only included in the two places it's needed?


    practicalswift commented at 4:46 PM on March 6, 2020:

    Good point. Now moved to golombrice.h. Please re-review :)

  13. DrahtBot added the label Needs rebase on Mar 5, 2020
  14. practicalswift force-pushed on Mar 6, 2020
  15. practicalswift force-pushed on Mar 6, 2020
  16. practicalswift force-pushed on Mar 6, 2020
  17. practicalswift force-pushed on Mar 6, 2020
  18. practicalswift force-pushed on Mar 6, 2020
  19. DrahtBot removed the label Needs rebase on Mar 6, 2020
  20. practicalswift force-pushed on Mar 9, 2020
  21. practicalswift commented at 3:13 PM on March 9, 2020: contributor

    Rebased :)

  22. DrahtBot added the label Needs rebase on Mar 9, 2020
  23. practicalswift force-pushed on Mar 9, 2020
  24. practicalswift commented at 7:24 PM on March 9, 2020: contributor

    Rebased again :)

  25. DrahtBot removed the label Needs rebase on Mar 9, 2020
  26. practicalswift force-pushed on Mar 18, 2020
  27. practicalswift commented at 10:17 PM on March 18, 2020: contributor

    Rebased again :)

  28. practicalswift commented at 12:27 PM on March 24, 2020: contributor

    @MarcoFalke Would you mind reviewing? :)

  29. in src/Makefile.test.include:470 in 69775ce05e outdated
     462 | @@ -462,6 +463,12 @@ test_fuzz_float_LDADD = $(FUZZ_SUITE_LD_COMMON)
     463 |  test_fuzz_float_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
     464 |  test_fuzz_float_SOURCES = $(FUZZ_SUITE) test/fuzz/float.cpp
     465 |  
     466 | +test_fuzz_golomb_rice_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
     467 | +test_fuzz_golomb_rice_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
     468 | +test_fuzz_golomb_rice_LDADD = $(FUZZ_SUITE_LD_COMMON)
     469 | +test_fuzz_golomb_rice_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
     470 | +test_fuzz_golomb_rice_SOURCES = $(FUZZ_SUITE) test/fuzz/golomb_rice.cpp
    


    MarcoFalke commented at 2:37 AM on April 5, 2020:
    test_fuzz_golomb_rice_SOURCES = test/fuzz/golomb_rice.cpp
    

    Needs rebase


    practicalswift commented at 2:14 PM on April 6, 2020:

    Fixed!

  30. practicalswift force-pushed on Apr 6, 2020
  31. practicalswift commented at 2:14 PM on April 6, 2020: contributor

    @MarcoFalke Feedback addressed. Ready for merge? :)

  32. practicalswift commented at 11:32 AM on April 20, 2020: contributor

    Anything left to do here? Would be nice to have fuzzing coverage for GolombRiceEncode/GolombRiceDecode and as an added bonus that would bump fuzzing line coverage above the magical 50% mark :)

  33. in src/Makefile.am:134 in e9f7138391 outdated
     130 | @@ -131,6 +131,7 @@ BITCOIN_CORE_H = \
     131 |    cuckoocache.h \
     132 |    flatfile.h \
     133 |    fs.h \
     134 | +  golombrice.h \
    


    MarcoFalke commented at 11:37 AM on April 20, 2020:

    Should probably be in util/?


    practicalswift commented at 11:56 AM on April 20, 2020:

    Done! :)

  34. practicalswift force-pushed on Apr 20, 2020
  35. practicalswift commented at 11:56 AM on April 20, 2020: contributor

    @MarcoFalke Feedback addressed! Please re-review :)

  36. MarcoFalke commented at 12:58 PM on April 20, 2020: member

    Can't merge with red travis

  37. tests: Add fuzzing harness for Golomb-Rice coding (GolombRiceEncode/GolombRiceDecode) 69749fbe6a
  38. practicalswift force-pushed on Apr 20, 2020
  39. practicalswift commented at 2:58 PM on April 20, 2020: contributor

    @MarcoFalke Oh, thanks! Header guard now updated after util/ move :)

  40. MarcoFalke merged this on Apr 20, 2020
  41. MarcoFalke closed this on Apr 20, 2020

  42. sidhujag referenced this in commit bf79945918 on Apr 20, 2020
  43. Fabcien referenced this in commit e7c737ed6f on Jan 21, 2021
  44. practicalswift deleted the branch on Apr 10, 2021
  45. kittywhiskers referenced this in commit 74f8fb3abf on May 7, 2022
  46. kittywhiskers referenced this in commit 41e87ea55a on May 7, 2022
  47. kittywhiskers referenced this in commit e6a08ef0f4 on Jun 14, 2022
  48. kittywhiskers referenced this in commit de7850de07 on Jun 14, 2022
  49. kittywhiskers referenced this in commit 5a3c0e24c8 on Jun 14, 2022
  50. kittywhiskers referenced this in commit c9b14c58b1 on Jun 18, 2022
  51. kittywhiskers referenced this in commit e0beac09d3 on Jun 18, 2022
  52. kittywhiskers referenced this in commit 0319d7ebd2 on Jul 4, 2022
  53. kittywhiskers referenced this in commit 89ef327936 on Jul 4, 2022
  54. kittywhiskers referenced this in commit 227a8a75c5 on Jul 6, 2022
  55. kittywhiskers referenced this in commit cafb363d35 on Jul 6, 2022
  56. kittywhiskers referenced this in commit 7f00a7ad5a on Jul 6, 2022
  57. kittywhiskers referenced this in commit 76a42975d7 on Jul 13, 2022
  58. kittywhiskers referenced this in commit f87fe36a15 on Jul 13, 2022
  59. kittywhiskers referenced this in commit b50f00a2d5 on Jul 15, 2022
  60. PastaPastaPasta referenced this in commit 30d6584cb6 on Jul 17, 2022
  61. DrahtBot locked this on Aug 16, 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-16 15:14 UTC

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