This commit is contained in:
Andrea Fioraldi 2021-02-23 20:49:15 +01:00
parent 9f12f9506c
commit 5695b4326a

View File

@ -84,10 +84,16 @@ fn fuzz(corpus_dirs: Vec<PathBuf>, objective_dir: PathBuf, broker_port: u16) ->
// If not restarting, create a State from scratch
let mut state = state.unwrap_or_else(|| {
State::new(
// RNG
StdRand::new(current_nanos()),
// Corpus that will be evolved, we keep it in memory for performance
InMemoryCorpus::new(),
// Feedbacks to rate the interestingness of an input
tuple_list!(MaxMapFeedback::new_with_observer("edges", &edges_observer)),
// Corpus in which we store solutions (crashes in this example),
// on disk so the user can get them after stopping the fuzzer
OnDiskCorpus::new(objective_dir),
// Feedbacks to recognize an input as solution
tuple_list!(CrashFeedback::new()),
)
});
@ -131,7 +137,7 @@ fn fuzz(corpus_dirs: Vec<PathBuf>, objective_dir: PathBuf, broker_port: u16) ->
// In case the corpus is empty (on first run), reset
if state.corpus().count() < 1 {
state
state
.load_initial_inputs(&mut executor, &mut restarting_mgr, &corpus_dirs)
.expect(&format!(
"Failed to load initial corpus at {:?}",