mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
dashify what made sense in fuzzing.md
Signed-off-by: Pasta <pasta@dashboost.org>
This commit is contained in:
parent
b1970add13
commit
51a4e11d6e
@ -1,7 +1,7 @@
|
||||
Fuzz-testing Bitcoin Core
|
||||
Fuzz-testing Dash Core
|
||||
==========================
|
||||
|
||||
A special test harness `test_bitcoin_fuzzy` is provided to provide an easy
|
||||
A special test harness `test_dash_fuzzy` is provided to provide an easy
|
||||
entry point for fuzzers and the like. In this document we'll describe how to
|
||||
use it with AFL.
|
||||
|
||||
@ -20,13 +20,13 @@ export AFLPATH=$PWD
|
||||
Instrumentation
|
||||
----------------
|
||||
|
||||
To build Bitcoin Core using AFL instrumentation (this assumes that the
|
||||
To build Dash Core using AFL instrumentation (this assumes that the
|
||||
`AFLPATH` was set as above):
|
||||
```
|
||||
./configure --disable-ccache --disable-shared --enable-tests CC=${AFLPATH}/afl-gcc CXX=${AFLPATH}/afl-g++
|
||||
export AFL_HARDEN=1
|
||||
cd src/
|
||||
make test/test_bitcoin_fuzzy
|
||||
make test/test_dash_fuzzy
|
||||
```
|
||||
We disable ccache because we don't want to pollute the ccache with instrumented
|
||||
objects, and similarly don't want to use non-instrumented cached objects linked
|
||||
@ -35,7 +35,7 @@ in.
|
||||
The fuzzing can be sped up significantly (~200x) by using `afl-clang-fast` and
|
||||
`afl-clang-fast++` in place of `afl-gcc` and `afl-g++` when compiling. When
|
||||
compiling using `afl-clang-fast`/`afl-clang-fast++` the resulting
|
||||
`test_bitcoin_fuzzy` binary will be instrumented in such a way that the AFL
|
||||
`test_dash_fuzzy` binary will be instrumented in such a way that the AFL
|
||||
features "persistent mode" and "deferred forkserver" can be used. See
|
||||
https://github.com/mcarpenter/afl/tree/master/llvm_mode for details.
|
||||
|
||||
@ -65,7 +65,7 @@ Fuzzing
|
||||
|
||||
To start the actual fuzzing use:
|
||||
```
|
||||
$AFLPATH/afl-fuzz -i ${AFLIN} -o ${AFLOUT} -m52 -- test/test_bitcoin_fuzzy
|
||||
$AFLPATH/afl-fuzz -i ${AFLIN} -o ${AFLOUT} -m52 -- test/test_dash_fuzzy
|
||||
```
|
||||
|
||||
You may have to change a few kernel parameters to test optimally - `afl-fuzz`
|
||||
|
Loading…
Reference in New Issue
Block a user