1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Demonstrates how `fuzz_with_reset!` improves AFL++ persistent mode stability
// when using static state.
//
// Setup:
// `cargo run -p cargo-afl -- afl build --example reset_demo --manifest-path afl/Cargo.toml`
// `mkdir -p /tmp/afl-input && echo "test" > /tmp/afl-input/seed`
//
// Without reset (low stability):
// `AFL_NO_UI=1 cargo run -p cargo-afl -- afl fuzz \
// -i /tmp/afl-input -o /tmp/afl-out-bad -V 15 target/debug/examples/reset_demo`
//
// With reset (high stability):
// `USE_RESET=1 AFL_NO_UI=1 cargo run -p cargo-afl -- afl fuzz \
// -i /tmp/afl-input -o /tmp/afl-out-reset -V 15 target/debug/examples/reset_demo`
//
// Compare stability:
// `grep stability /tmp/afl-out-bad/default/fuzzer_stats /tmp/afl-out-reset/default/fuzzer_stats`
use Mutex;
static CACHE: = new;