fuzz: Fill various small fuzzing gaps #20377

pull practicalswift wants to merge 2 commits into bitcoin:master from practicalswift:fuzzers-2020-11-12 changing 3 files +72 −1
  1. practicalswift commented at 3:29 PM on November 12, 2020: contributor

    Fill various small fuzzing gaps.

    See doc/fuzzing.md for information on how to fuzz Bitcoin Core. Don't forget to contribute any coverage increasing inputs you find to the Bitcoin Core fuzzing corpus repo.

    Happy fuzzing :)

  2. DrahtBot added the label Build system on Nov 12, 2020
  3. DrahtBot cross-referenced this on Dec 4, 2020 from issue fuzz: Link all targets once by MarcoFalke
  4. DrahtBot commented at 1:53 AM on December 4, 2020: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

  5. in src/test/fuzz/data_stream.cpp:24 in 2b49380c2c outdated
      19 | +void test_one_input(const std::vector<uint8_t>& buffer)
      20 | +{
      21 | +    FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
      22 | +    CDataStream data_stream = ConsumeDataStream(fuzzed_data_provider);
      23 | +    switch (fuzzed_data_provider.ConsumeIntegralInRange<int>(0, 1)) {
      24 | +    case 0: {
    


    MarcoFalke commented at 6:27 PM on December 15, 2020:

    I don't really like re-using the same seed for different serialization formats. I think it would be better to have separate targets (and folders) for this


    practicalswift commented at 12:40 PM on December 16, 2020:

    Fixed!

  6. DrahtBot added the label Needs rebase on Dec 15, 2020
  7. practicalswift force-pushed on Dec 16, 2020
  8. practicalswift force-pushed on Dec 16, 2020
  9. in src/test/fuzz/kitchen_sink.cpp:29 in 7e453b6546 outdated
      24 | @@ -23,4 +25,19 @@ FUZZ_TARGET(kitchen_sink)
      25 |      (void)JSONRPCTransactionError(transaction_error);
      26 |      (void)RPCErrorFromTransactionError(transaction_error);
      27 |      (void)TransactionErrorString(transaction_error);
      28 | +
      29 | +    (void)StringForFeeEstimateHorizon(fuzzed_data_provider.PickValueInArray({FeeEstimateHorizon::SHORT_HALFLIFE, FeeEstimateHorizon::MED_HALFLIFE, FeeEstimateHorizon::LONG_HALFLIFE}));
    


    MarcoFalke commented at 1:05 PM on December 16, 2020:

    would be nice to introduce an ALL_FEE_EST_HORIZON constexpr


    practicalswift commented at 2:26 PM on December 16, 2020:

    Fixed!

  10. in src/test/fuzz/data_stream.cpp:19 in 7e453b6546 outdated
      14 | +void initialize_data_stream()
      15 | +{
      16 | +    InitializeFuzzingContext();
      17 | +}
      18 | +
      19 | +FUZZ_TARGET_INIT(data_stream, initialize_data_stream)
    


    MarcoFalke commented at 1:05 PM on December 16, 2020:
    FUZZ_TARGET_INIT(data_stream_addr_man, initialize_data_stream_addr_man)
    

    practicalswift commented at 2:26 PM on December 16, 2020:

    Fixed!

  11. MarcoFalke approved
  12. MarcoFalke commented at 1:05 PM on December 16, 2020: member

    ACK, some nits

  13. DrahtBot removed the label Needs rebase on Dec 16, 2020
  14. fuzz: Fill various small fuzzing gaps 546a0764f3
  15. practicalswift force-pushed on Dec 16, 2020
  16. practicalswift commented at 2:29 PM on December 16, 2020: contributor

    @MarcoFalke Thanks for reviewing. Feedback addressed. Please re-review :)

  17. in src/test/fuzz/data_stream.cpp:29 in 09f43e1372 outdated
      24 | +    CAddrDB::Read(addr_man, data_stream);
      25 | +}
      26 | +
      27 | +void initialize_data_stream_net_message()
      28 | +{
      29 | +    InitializeFuzzingContext();
    


    MarcoFalke commented at 6:30 PM on December 26, 2020:

    Can you explain why it is required to boot up a full node to call a single constructor that only invokes std::move. Maybe the whole fuzz test isn't particularly useful, when it only calls std::move, which is already covered by other fuzz targets: https://marcofalke.github.io/btc_cov/fuzz.coverage/src/net.h.gcov.html#745


    practicalswift commented at 7:28 PM on December 27, 2020:

    Good catch. Removing :)

  18. fuzz: Add coverage for CDataStream consumer 4ddbcd0d9a
  19. practicalswift force-pushed on Dec 27, 2020
  20. practicalswift commented at 7:29 PM on December 27, 2020: contributor

    Feedback addressed. Should hopefully be ready for final review :)

  21. MarcoFalke commented at 8:27 AM on December 29, 2020: member

    review ACK 4ddbcd0d9abe40cd387e63d8c4817e0fe36004dc

  22. MarcoFalke merged this on Dec 29, 2020
  23. MarcoFalke closed this on Dec 29, 2020

  24. sidhujag referenced this in commit f29711231b on Dec 29, 2020
  25. practicalswift deleted the branch on Apr 10, 2021
  26. bitcoin 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-05-20 06:54 UTC