Fix qemu_launcher by moving stop request handling to fuzz_one (#2394)
Co-authored-by: Romain Malmain <romain.malmain@pm.me>
This commit is contained in:
parent
ea3e70b6e5
commit
fed61eb6b8
@ -212,7 +212,7 @@ pub trait Fuzzer<E, EM, ST>: Sized + UsesState
|
|||||||
where
|
where
|
||||||
Self::State: HasMetadata + HasExecutions + HasLastReportTime + Stoppable,
|
Self::State: HasMetadata + HasExecutions + HasLastReportTime + Stoppable,
|
||||||
E: UsesState<State = Self::State>,
|
E: UsesState<State = Self::State>,
|
||||||
EM: ProgressReporter<State = Self::State> + EventProcessor<E, Self>,
|
EM: ProgressReporter<State = Self::State>,
|
||||||
ST: StagesTuple<E, EM, Self::State, Self>,
|
ST: StagesTuple<E, EM, Self::State, Self>,
|
||||||
{
|
{
|
||||||
/// Fuzz for a single iteration.
|
/// Fuzz for a single iteration.
|
||||||
@ -244,14 +244,8 @@ where
|
|||||||
loop {
|
loop {
|
||||||
// log::info!("Starting another fuzz_loop");
|
// log::info!("Starting another fuzz_loop");
|
||||||
manager.maybe_report_progress(state, monitor_timeout)?;
|
manager.maybe_report_progress(state, monitor_timeout)?;
|
||||||
if state.stop_requested() {
|
|
||||||
state.discard_stop_request();
|
|
||||||
manager.on_shutdown()?;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
self.fuzz_one(stages, executor, state, manager)?;
|
self.fuzz_one(stages, executor, state, manager)?;
|
||||||
}
|
}
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Fuzz for n iterations.
|
/// Fuzz for n iterations.
|
||||||
@ -282,10 +276,6 @@ where
|
|||||||
|
|
||||||
for _ in 0..iters {
|
for _ in 0..iters {
|
||||||
manager.maybe_report_progress(state, monitor_timeout)?;
|
manager.maybe_report_progress(state, monitor_timeout)?;
|
||||||
if state.stop_requested() {
|
|
||||||
state.discard_stop_request();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
ret = Some(self.fuzz_one(stages, executor, state, manager)?);
|
ret = Some(self.fuzz_one(stages, executor, state, manager)?);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -834,6 +824,12 @@ where
|
|||||||
|
|
||||||
state.clear_corpus_id()?;
|
state.clear_corpus_id()?;
|
||||||
|
|
||||||
|
if state.stop_requested() {
|
||||||
|
state.discard_stop_request();
|
||||||
|
manager.on_shutdown()?;
|
||||||
|
return Err(Error::shutting_down())
|
||||||
|
}
|
||||||
|
|
||||||
Ok(id)
|
Ok(id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user