HomePhabricator

[backport#17076] tests: Add fuzzing harness for CheckTransaction(...)…

Description

[backport#17076] tests: Add fuzzing harness for CheckTransaction(...), IsStandardTx(...) and other CTransaction related functions

Summary:
5c2987636faa5bc175b37b81fd98ab48e576da0b tests: Remove TRANSACTION_DESERIALIZE (replaced by transaction fuzzer) (practicalswift)
0a573682f24d20cb178b8b6f97c35ec46901c4db tests: Add fuzzing harness for CheckTransaction(...), IsStandardTx(...) and other CTransaction related functions (practicalswift)

Pull request description:

Add fuzzing harness for `CheckTransaction(...)`, `IsStandardTx(...)` and other `CTransaction` related functions.

**Testing this PR**

Run:

```
$ CC=clang CXX=clang++ ./configure --enable-fuzz --with-sanitizers=address,fuzzer,undefined
$ make
$ src/test/fuzz/transaction
…
# And to to quickly verify that the relevant code regions are triggered, that the
# fuzzing throughput seems reasonable, etc.
$ contrib/devtools/test_fuzzing_harnesses.sh '^transaction$'
```

`test_fuzzing_harnesses.sh` can be found in PR #17000.

Depends on D6740

Backport of Core PR17076

Test Plan:

export CC=clang CXX=clang++
../configure --enable-fuzz --with-sanitizers=fuzzer,address \
  --disable-wallet \
  --disable-bench \
  --with-utils=no \
  --with-daemon=no \
  --with-libs=no \
  --with-gui=no \
  --with-seeder=no
make
mkdir -p test/fuzz
cp ../test/fuzz/test_runner.py test/fuzz/
./test/fuzz/test_runner.py -l DEBUG <path_to_corpus>

cmake -GNinja .. -DENABLE_SANITIZERS="address;fuzzer" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
ninja bitcoin-fuzzers link-fuzz-test_runner.py
./test/fuzz/test_runner.py -l DEBUG <path_to_corpus>

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D6741

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Oct 10 2019, 13:18
majcostaCommitted on Jul 1 2020, 18:21
majcostaPushed on Jul 1 2020, 18:21
Reviewer
Restricted Project
Differential Revision
D6741: [backport#17076] tests: Add fuzzing harness for CheckTransaction(...), IsStandardTx(...) and other CTransaction related functions
Parents
rABCae150fdf9d0b: Cleanup unused --with-phononactivation from test_framework
Branches
Unknown
Tags
Unknown