From 2137ad0f8f122392304666cd1f546fdbc0e75114 Mon Sep 17 00:00:00 2001 From: "Dongjia \"toka\" Zhang" Date: Tue, 2 Apr 2024 13:26:47 +0200 Subject: [PATCH] Don't resume in std mutational stage (#1946) * fix * fix * fix * fix * FMT * don't resume in mutational stage --- libafl/src/stages/mutational.rs | 13 +++++++++---- libafl/src/stages/power.rs | 10 ++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/libafl/src/stages/mutational.rs b/libafl/src/stages/mutational.rs index 1f39e2747d..39d250c45a 100644 --- a/libafl/src/stages/mutational.rs +++ b/libafl/src/stages/mutational.rs @@ -111,9 +111,12 @@ where start_timer!(state); // Here saturating_sub is needed as self.iterations() might be actually smaller than the previous value before reset. + /* let num = self .iterations(state)? .saturating_sub(self.execs_since_progress_start(state)?); + */ + let num = self.iterations(state)?; let mut testcase = state.current_testcase_mut()?; let Ok(input) = I::try_transform_from(&mut testcase, state) else { @@ -232,12 +235,14 @@ where ret } - fn restart_progress_should_run(&mut self, state: &mut Self::State) -> Result { - self.restart_helper.restart_progress_should_run(state) + fn restart_progress_should_run(&mut self, _state: &mut Self::State) -> Result { + Ok(true) + // self.restart_helper.restart_progress_should_run(state) } - fn clear_restart_progress(&mut self, state: &mut Self::State) -> Result<(), Error> { - self.restart_helper.clear_restart_progress(state) + fn clear_restart_progress(&mut self, _state: &mut Self::State) -> Result<(), Error> { + Ok(()) + // self.restart_helper.clear_restart_progress(state) } } diff --git a/libafl/src/stages/power.rs b/libafl/src/stages/power.rs index 6b34b51c9e..c81177e629 100644 --- a/libafl/src/stages/power.rs +++ b/libafl/src/stages/power.rs @@ -90,12 +90,14 @@ where ret } - fn restart_progress_should_run(&mut self, state: &mut Self::State) -> Result { - self.restart_helper.restart_progress_should_run(state) + fn restart_progress_should_run(&mut self, _state: &mut Self::State) -> Result { + Ok(true) + // self.restart_helper.restart_progress_should_run(state) } - fn clear_restart_progress(&mut self, state: &mut Self::State) -> Result<(), Error> { - self.restart_helper.clear_restart_progress(state) + fn clear_restart_progress(&mut self, _state: &mut Self::State) -> Result<(), Error> { + Ok(()) + // self.restart_helper.clear_restart_progress(state) } }