From 62484b12f479b6465043027891b5f637f649c8d8 Mon Sep 17 00:00:00 2001 From: Dongjia Zhang Date: Thu, 12 May 2022 18:14:21 +0900 Subject: [PATCH] Call post_exec_all() in calibrate.rs (#603) * fix * fix * fix * post_exec * fix --- libafl/src/stages/calibrate.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/libafl/src/stages/calibrate.rs b/libafl/src/stages/calibrate.rs index bfa77e7ea1..6e94b67b33 100644 --- a/libafl/src/stages/calibrate.rs +++ b/libafl/src/stages/calibrate.rs @@ -74,9 +74,11 @@ where // Run once to get the initial calibration map executor.observers_mut().pre_exec_all(state, &input)?; + let mut start = current_time(); - let mut total_time = if executor.run_target(fuzzer, state, mgr, &input)? == ExitKind::Ok { + let exit_kind = executor.run_target(fuzzer, state, mgr, &input)?; + let mut total_time = if exit_kind == ExitKind::Ok { current_time() - start } else { mgr.log( @@ -88,6 +90,10 @@ where Duration::from_secs(1) }; + executor + .observers_mut() + .post_exec_all(state, &input, &exit_kind)?; + let map_first = &executor .observers() .match_name::(&self.map_observer_name) @@ -111,7 +117,8 @@ where executor.observers_mut().pre_exec_all(state, &input)?; start = current_time(); - if executor.run_target(fuzzer, state, mgr, &input)? != ExitKind::Ok { + let exit_kind = executor.run_target(fuzzer, state, mgr, &input)?; + if exit_kind != ExitKind::Ok { if !has_errors { mgr.log( state, @@ -129,6 +136,10 @@ where total_time += current_time() - start; + executor + .observers_mut() + .post_exec_all(state, &input, &exit_kind)?; + let map = &executor .observers() .match_name::(&self.map_observer_name)