@@ -6,7 +6,9 @@ Fuzz tests generate a ton of random parameter arguments to the program and then
6
6
7
7
Typically, Travis CI will run ` travis-fuzz.sh ` on one of the environments the automated tests are configured for.
8
8
This is the most time-consuming component of the continuous integration workflow, so it is recommended that you detect
9
- issues locally, and Travis merely acts as a sanity check.
9
+ issues locally, and Travis merely acts as a sanity check. Fuzzing is further only effective with
10
+ a lot of CPU time, indicating that if crash scenarios are discovered on Travis with its low
11
+ runtime constraints, the crash is caused relatively easily.
10
12
11
13
## How do I run fuzz tests locally?
12
14
@@ -19,7 +21,7 @@ To install `honggfuzz`, simply run
19
21
20
22
``` shell
21
23
cargo update
22
- cargo install honggfuzz --force
24
+ cargo install --force honggfuzz
23
25
```
24
26
25
27
### Execution
@@ -55,6 +57,7 @@ Seen a crash. Terminating all fuzzing threads
55
57
56
58
… # a lot of lines in between
57
59
60
+ <0x0000555555565559> [func:UNKNOWN file: line:0 module:/home/travis/build/rust-bitcoin/rust-lightning/fuzz/hfuzz_target/x86_64-unknown-linux-gnu/release/full_stack_target]
58
61
<0x0000000000000000> [func:UNKNOWN file: line:0 module:UNKNOWN]
59
62
=====================================================================
60
63
2d3136383734090101010101010101010101010101010101010101010101
@@ -63,13 +66,18 @@ Seen a crash. Terminating all fuzzing threads
63
66
The command "if [ "$(rustup show | grep default | grep stable)" != "" ]; then cd fuzz && cargo test --verbose && ./travis-fuzz.sh; fi" exited with 1.
64
67
```
65
68
66
- Simply copy the hex, and run the following from the ` fuzz ` directory:
69
+ Note that the penultimate stack trace line ends in ` release/full_stack_target] ` . That indicates that
70
+ the failing target was ` full_stack ` . To reproduce the error locally, simply copy the hex,
71
+ and run the following from the ` fuzz ` directory:
67
72
68
73
``` shell
74
+ export TARGET=" full_stack" # adjust for your output
69
75
export HEX=" 2d3136383734090101010101010101010101010101010101010101010101\
70
76
010101010100040101010101010101010101010103010101010100010101\
71
77
0069d07c319a4961" # adjust for your output
72
- echo $HEX | xxd -r -p > ./test_cases/full_stack/your_test_case_name
78
+
79
+ mkdir -p ./test_cases/$TARGET
80
+ echo $HEX | xxd -r -p > ./test_cases/$TARGET /any_filename_works
73
81
74
82
export RUST_BACKTRACE=1
75
83
cargo test
0 commit comments