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:

    $ CC=clang CXX=clang++ ./configure --enable-fuzz --with-sanitizers=address,fuzzer,undefined
    $ make
    $ 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: contributor

    <!--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:

    • #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:

    Make CTransaction and CMutableTransaction share the same corpus.
    Verify 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 cross-referenced this on Oct 13, 2019 from issue CExtKey::Unserialize and CExtPubKey::Unserialize throw std::runtime_error instead of the expected std::ios_base::failure by practicalswift
  14. practicalswift force-pushed on Oct 14, 2019
  15. DrahtBot added the label Needs rebase on Oct 16, 2019
  16. practicalswift force-pushed on Oct 16, 2019
  17. DrahtBot removed the label Needs rebase on Oct 16, 2019
  18. practicalswift cross-referenced this on Oct 23, 2019 from issue tests: Test serialisation as part of deserialisation fuzzing. Test round-trip equality where possible. by practicalswift
  19. DrahtBot added the label Needs rebase on Oct 24, 2019
  20. practicalswift force-pushed on Oct 24, 2019
  21. practicalswift force-pushed on Oct 24, 2019
  22. practicalswift commented at 9:54 PM on October 24, 2019: contributor

    Rebased!

  23. DrahtBot removed the label Needs rebase on Oct 24, 2019
  24. DrahtBot added the label Needs rebase on Oct 25, 2019
  25. practicalswift force-pushed on Oct 25, 2019
  26. DrahtBot removed the label Needs rebase on Oct 25, 2019
  27. DrahtBot added the label Needs rebase on Oct 30, 2019
  28. practicalswift force-pushed on Oct 30, 2019
  29. practicalswift commented at 9:20 PM on October 30, 2019: contributor

    Rebased!

  30. DrahtBot removed the label Needs rebase on Oct 30, 2019
  31. practicalswift cross-referenced this on Oct 31, 2019 from issue Add fuzzing seeds to recently contributed fuzzing harnesses by practicalswift
  32. DrahtBot added the label Needs rebase on Nov 18, 2019
  33. tests: Add corpora suppression (FUZZERS_MISSING_CORPORA) for fuzzers missing in https://github.com/bitcoin-core/qa-assets/tree/master/fuzz_seed_corpus 16f0a186dc
  34. tests: Add deserialization fuzzing harnesses 897849d8c2
  35. practicalswift force-pushed on Nov 21, 2019
  36. practicalswift commented at 5:53 PM on November 21, 2019: contributor

    Rebased! :)

  37. DrahtBot removed the label Needs rebase on Nov 21, 2019
  38. practicalswift closed this on Dec 5, 2019

  39. practicalswift commented at 6:56 AM on December 6, 2019: contributor

    Closing due to lack of interest

  40. 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.

  41. 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 :)

  42. practicalswift reopened this on Dec 6, 2019

  43. laanwj commented at 8:17 AM on December 6, 2019: member

    thanks, ACK 897849d8c225045f0dd3a2fe99b5d69bdf84b4e2

  44. laanwj referenced this in commit cb11324a63 on Dec 6, 2019
  45. laanwj merged this on Dec 6, 2019
  46. laanwj closed this on Dec 6, 2019

  47. jonatack commented at 10:40 AM on December 6, 2019: contributor

    ACK 897849d

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

  48. sidhujag referenced this in commit 3e39c95207 on Dec 6, 2019
  49. MarkLTZ cross-referenced this on Apr 4, 2020 from issue Bitcoin PR tracking by MarkLTZ
  50. jasonbcox referenced this in commit 27e9ca8f6e on Jul 17, 2020
  51. sidhujag referenced this in commit 2a85553e25 on Nov 10, 2020
  52. furszy cross-referenced this on Mar 24, 2021 from issue Fuzzing framework support by furszy
  53. practicalswift deleted the branch on Apr 10, 2021
  54. random-zebra referenced this in commit 44b5327e61 on May 28, 2021
  55. kwvg referenced this in commit b6583acbc1 on Aug 2, 2021
  56. kwvg referenced this in commit 6c8933ace0 on Aug 5, 2021
  57. kwvg referenced this in commit ade8464c79 on Aug 5, 2021
  58. kwvg referenced this in commit 569a711a12 on Aug 5, 2021
  59. PastaPastaPasta referenced this in commit 3758c58fb3 on Aug 6, 2021
  60. kwvg referenced this in commit bad14f54c2 on Aug 8, 2021
  61. kwvg referenced this in commit 4e6aca0ac1 on Aug 11, 2021
  62. 5tefan referenced this in commit 49f8ea5197 on Aug 12, 2021
  63. gades referenced this in commit 1f8162dd8e on May 6, 2022
  64. 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-19 07:54 UTC

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