diff --git a/libafl/src/fuzzer.rs b/libafl/src/fuzzer.rs index f24b2e5fc5..9016198f14 100644 --- a/libafl/src/fuzzer.rs +++ b/libafl/src/fuzzer.rs @@ -73,6 +73,10 @@ pub trait Fuzzer { /// Fuzz for n iterations /// Returns the index of the last fuzzed corpus item + /// + /// If you use this fn in a restarting scenario to only run for `n` iterations, + /// before exiting, make sure you call `event_mgr.on_restart(state)?;`. + /// This way, the state will be available in the next, respawned, iteration. fn fuzz_loop_for( &mut self, state: &mut S, @@ -95,6 +99,7 @@ pub trait Fuzzer { ret = self.fuzz_one(state, executor, manager, scheduler)?; last = Self::maybe_report_stats(state, manager, last, stats_timeout)?; } + Ok(ret) }