diff options
author | Wladimir J. van der Laan <laanwj@protonmail.com> | 2019-12-06 09:45:19 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@protonmail.com> | 2019-12-06 09:45:26 +0100 |
commit | cb11324a63ef10475bfc4d8e45148d5ae6f3e71e (patch) | |
tree | 114db5aa0e4c7b3703208c67d3347964634b063d /test | |
parent | c7c9c44278471228376ee29f2852dcfc6b58cb93 (diff) | |
parent | 897849d8c225045f0dd3a2fe99b5d69bdf84b4e2 (diff) |
Merge #17051: tests: Add deserialization fuzzing harnesses
897849d8c225045f0dd3a2fe99b5d69bdf84b4e2 tests: Add deserialization fuzzing harnesses (practicalswift)
16f0a186dcee563bb1000e1ffc51da87e7623bc6 tests: Add corpora suppression (FUZZERS_MISSING_CORPORA) for fuzzers missing in https://github.com/bitcoin-core/qa-assets/tree/master/fuzz_seed_corpus (practicalswift)
Pull request description:
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.
ACKs for top commit:
laanwj:
thanks, ACK 897849d8c225045f0dd3a2fe99b5d69bdf84b4e2
Tree-SHA512: 5a270a3002cc23b725f7b35476a43777b2b00b4d089cc006372e2fcc7afa430afaa3c1430f778ae08fc53dd85a13e7bd2fab0449c319f676423226e189a417f6
Diffstat (limited to 'test')
-rwxr-xr-x | test/fuzz/test_runner.py | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/test/fuzz/test_runner.py b/test/fuzz/test_runner.py index fde99fe496..ffebb579e7 100755 --- a/test/fuzz/test_runner.py +++ b/test/fuzz/test_runner.py @@ -12,6 +12,27 @@ import sys import subprocess import logging +# Fuzzers known to lack a seed corpus in https://github.com/bitcoin-core/qa-assets/tree/master/fuzz_seed_corpus +FUZZERS_MISSING_CORPORA = [ + "addr_info_deserialize", + "block_file_info_deserialize", + "block_filter_deserialize", + "block_header_and_short_txids_deserialize", + "fee_rate_deserialize", + "flat_file_pos_deserialize", + "key_origin_info_deserialize", + "merkle_block_deserialize", + "out_point_deserialize", + "partial_merkle_tree_deserialize", + "partially_signed_transaction_deserialize", + "prefilled_transaction_deserialize", + "psbt_input_deserialize", + "psbt_output_deserialize", + "pub_key_deserialize", + "script_deserialize", + "sub_net_deserialize", + "tx_in_deserialize", +] def main(): parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) @@ -100,10 +121,14 @@ def main(): def run_once(*, corpus, test_list, build_dir, export_coverage): for t in test_list: + corpus_path = os.path.join(corpus, t) + if t in FUZZERS_MISSING_CORPORA: + os.makedirs(corpus_path, exist_ok=True) args = [ os.path.join(build_dir, 'src', 'test', 'fuzz', t), '-runs=1', - os.path.join(corpus, t), + '-detect_leaks=0', + corpus_path, ] logging.debug('Run {} with args {}'.format(t, args)) result = subprocess.run(args, stderr=subprocess.PIPE, universal_newlines=True) |