From 686d29a3cb7738746276e64ea2a536759a829f45 Mon Sep 17 00:00:00 2001 From: tbethe <58276357+tbethe@users.noreply.github.com> Date: Tue, 5 Dec 2023 19:38:17 +0000 Subject: [PATCH] Don't reset child_pid in forkserver executors (#1715) Child pid is no longer reset after a run in persistent mode Co-authored-by: Timme Bethe --- libafl/src/executors/forkserver.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libafl/src/executors/forkserver.rs b/libafl/src/executors/forkserver.rs index d228e2e17f..389279e035 100644 --- a/libafl/src/executors/forkserver.rs +++ b/libafl/src/executors/forkserver.rs @@ -627,7 +627,9 @@ where exit_kind = ExitKind::Timeout; } - self.executor.forkserver_mut().reset_child_pid(); + if !libc::WIFSTOPPED(self.executor.forkserver().status()) { + self.executor.forkserver_mut().reset_child_pid(); + } Ok(exit_kind) } @@ -1310,7 +1312,9 @@ where } } - self.forkserver.reset_child_pid(); + if !libc::WIFSTOPPED(self.forkserver.status) { + self.forkserver.reset_child_pid(); + } // Clear the observer map after the execution is finished compiler_fence(Ordering::SeqCst);