tests: Add deserialization fuzzing harnesses #17051

pull practicalswift wants to merge 2 commits into bitcoin:master from practicalswift:fuzzers-deserialize changing 4 files +385 −108
  1. practicalswift commented at 2:31 pm on October 4, 2019: contributor

    Add deserialization fuzzing harnesses.

    Testing this PR

    Run:

    0$ CC=clang CXX=clang++ ./configure --enable-fuzz --with-sanitizers=address,fuzzer,undefined
    1$ make
    2$ contrib/devtools/test_fuzzing_harnesses.sh 'addr_info|block_file_info|block_filter|block_header|ext_key|ext_pub_key|fee_rate|flat_file|key_origin|merkle_block|mutable_transaction|out_point|partial_merkle_tree|partially_signed_transaction|prefilled_transaction|psbt_input|psbt_output|pub_key|script_deserialize|sub_net|tx_in' 10
    

    test_fuzzing_harnesses.sh can be found in PR #17000.

  2. fanquake added the label Tests on Oct 4, 2019
  3. DrahtBot commented at 4:02 pm on October 4, 2019: member

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

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #17229 (tests: Add fuzzing harnesses for various Base{32,58,64} and hex related functions by practicalswift)
    • #17225 (tests: Test serialisation as part of deserialisation fuzzing. Test round-trip equality where possible. by practicalswift)
    • #17109 (tests: Add fuzzing harness for various functions consuming only integrals by practicalswift)
    • #17093 (tests: Add fuzzing harness for various CTx{In,Out} related functions by practicalswift)
    • #17071 (tests: Add fuzzing harness for CheckBlock(…) and other CBlock related functions by practicalswift)
    • #17050 (tests: Add fuzzing harnesses for functions parsing scripts, numbers, JSON and HD keypaths (bip32) by practicalswift)
    • #10785 (Serialization improvements by sipa)

    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.

  4. DrahtBot added the label Needs rebase on Oct 10, 2019
  5. practicalswift force-pushed on Oct 10, 2019
  6. practicalswift force-pushed on Oct 10, 2019
  7. DrahtBot removed the label Needs rebase on Oct 10, 2019
  8. in src/test/fuzz/deserialize.cpp:93 in 9e11f4e882 outdated
    89+        ds >> merkle_block;
    90+    } catch (const std::ios_base::failure&) {
    91+    }
    92+#elif MUTABLE_TRANSACTION_DESERIALIZE
    93+    try {
    94+        CMutableTransaction mutable_transaction;
    


    MarcoFalke commented at 5:44 pm on October 10, 2019:
    Couldn’t this be put in the transaction fuzzer? Both CMutableTransaction and CTransaction are (de)serialized in the same way

    MarcoFalke commented at 5:45 pm on October 10, 2019:
    So, no need to duplicate seeds.

    practicalswift commented at 7:31 pm on October 10, 2019:

    Very good point!

    Added commit:

    0Make CTransaction and CMutableTransaction share the same corpus.
    1Verify that they are (de)serialized in the same way.
    

    Please re-review :)

  9. practicalswift force-pushed on Oct 10, 2019
  10. practicalswift force-pushed on Oct 10, 2019
  11. practicalswift force-pushed on Oct 10, 2019
  12. practicalswift force-pushed on Oct 11, 2019
  13. practicalswift force-pushed on Oct 14, 2019
  14. DrahtBot added the label Needs rebase on Oct 16, 2019
  15. practicalswift force-pushed on Oct 16, 2019
  16. DrahtBot removed the label Needs rebase on Oct 16, 2019
  17. DrahtBot added the label Needs rebase on Oct 24, 2019
  18. practicalswift force-pushed on Oct 24, 2019
  19. practicalswift force-pushed on Oct 24, 2019
  20. practicalswift commented at 9:54 pm on October 24, 2019: contributor
    Rebased!
  21. DrahtBot removed the label Needs rebase on Oct 24, 2019
  22. DrahtBot added the label Needs rebase on Oct 25, 2019
  23. practicalswift force-pushed on Oct 25, 2019
  24. DrahtBot removed the label Needs rebase on Oct 25, 2019
  25. DrahtBot added the label Needs rebase on Oct 30, 2019
  26. practicalswift force-pushed on Oct 30, 2019
  27. practicalswift commented at 9:20 pm on October 30, 2019: contributor
    Rebased!
  28. DrahtBot removed the label Needs rebase on Oct 30, 2019
  29. DrahtBot added the label Needs rebase on Nov 18, 2019
  30. tests: Add corpora suppression (FUZZERS_MISSING_CORPORA) for fuzzers missing in https://github.com/bitcoin-core/qa-assets/tree/master/fuzz_seed_corpus 16f0a186dc
  31. tests: Add deserialization fuzzing harnesses 897849d8c2
  32. practicalswift force-pushed on Nov 21, 2019
  33. practicalswift commented at 5:53 pm on November 21, 2019: contributor
    Rebased! :)
  34. DrahtBot removed the label Needs rebase on Nov 21, 2019
  35. practicalswift closed this on Dec 5, 2019

  36. practicalswift commented at 6:56 am on December 6, 2019: contributor
    Closing due to lack of interest
  37. laanwj commented at 7:49 am on December 6, 2019: member

    This does zero changes to non-fuzzer code, we should probably just merge this.

    But this is what I meant when I commented on it earlier, with it being better to group things in one PR, if you keep opening similar-sounding PRs, reviewers are going to pay less attention to them.

  38. practicalswift commented at 8:11 am on December 6, 2019: contributor

    @laanwj @MarcoFalke

    OK, I’m re-opening for now - feel free to merge :)

    I’m fuzzing my own custom fuzzing repo continuously using a very large fuzzing farm, but it sure would be nice to have this upstreamed to keep things simple and so that others could benefit from the code as well :)

  39. practicalswift reopened this on Dec 6, 2019

  40. laanwj commented at 8:17 am on December 6, 2019: member
    thanks, ACK 897849d8c225045f0dd3a2fe99b5d69bdf84b4e2
  41. laanwj referenced this in commit cb11324a63 on Dec 6, 2019
  42. laanwj merged this on Dec 6, 2019
  43. laanwj closed this on Dec 6, 2019

  44. jonatack commented at 10:40 am on December 6, 2019: member

    ACK 897849d

    Light code review, built, ran test_fuzzing_harnesses.sh. Output in this gist.

  45. sidhujag referenced this in commit 3e39c95207 on Dec 6, 2019
  46. jasonbcox referenced this in commit 27e9ca8f6e on Jul 17, 2020
  47. sidhujag referenced this in commit 2a85553e25 on Nov 10, 2020
  48. practicalswift deleted the branch on Apr 10, 2021
  49. random-zebra referenced this in commit 44b5327e61 on May 28, 2021
  50. kittywhiskers referenced this in commit b6583acbc1 on Aug 2, 2021
  51. kittywhiskers referenced this in commit 6c8933ace0 on Aug 5, 2021
  52. kittywhiskers referenced this in commit ade8464c79 on Aug 5, 2021
  53. kittywhiskers referenced this in commit 569a711a12 on Aug 5, 2021
  54. PastaPastaPasta referenced this in commit 3758c58fb3 on Aug 6, 2021
  55. kittywhiskers referenced this in commit bad14f54c2 on Aug 8, 2021
  56. kittywhiskers referenced this in commit 4e6aca0ac1 on Aug 11, 2021
  57. 5tefan referenced this in commit 49f8ea5197 on Aug 12, 2021
  58. gades referenced this in commit 1f8162dd8e on May 6, 2022
  59. 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