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 commented at 1:53 am on December 4, 2020: member

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

    Conflicts

    No conflicts as of last run.

  4. 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!
  5. DrahtBot added the label Needs rebase on Dec 15, 2020
  6. practicalswift force-pushed on Dec 16, 2020
  7. practicalswift force-pushed on Dec 16, 2020
  8. 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!
  9. 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:
    0FUZZ_TARGET_INIT(data_stream_addr_man, initialize_data_stream_addr_man)
    

    practicalswift commented at 2:26 pm on December 16, 2020:
    Fixed!
  10. MarcoFalke approved
  11. MarcoFalke commented at 1:05 pm on December 16, 2020: member
    ACK, some nits
  12. DrahtBot removed the label Needs rebase on Dec 16, 2020
  13. fuzz: Fill various small fuzzing gaps 546a0764f3
  14. practicalswift force-pushed on Dec 16, 2020
  15. practicalswift commented at 2:29 pm on December 16, 2020: contributor
    @MarcoFalke Thanks for reviewing. Feedback addressed. Please re-review :)
  16. 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 :)
  17. fuzz: Add coverage for CDataStream consumer 4ddbcd0d9a
  18. practicalswift force-pushed on Dec 27, 2020
  19. practicalswift commented at 7:29 pm on December 27, 2020: contributor
    Feedback addressed. Should hopefully be ready for final review :)
  20. MarcoFalke commented at 8:27 am on December 29, 2020: member
    review ACK 4ddbcd0d9abe40cd387e63d8c4817e0fe36004dc
  21. MarcoFalke merged this on Dec 29, 2020
  22. MarcoFalke closed this on Dec 29, 2020

  23. sidhujag referenced this in commit f29711231b on Dec 29, 2020
  24. practicalswift deleted the branch on Apr 10, 2021
  25. 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: 2024-11-17 12:12 UTC

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