diff --git a/libafl/src/events/centralized.rs b/libafl/src/events/centralized.rs index 40fb0b84d4..2e0d7ad48d 100644 --- a/libafl/src/events/centralized.rs +++ b/libafl/src/events/centralized.rs @@ -644,10 +644,10 @@ where input, client_config, exit_kind, - corpus_size: _, + corpus_size, observers_buf, - time: _, - executions: _, + time, + executions, forward_id, } => { log::info!("Received new Testcase from {client_id:?} ({client_config:?}, forward {forward_id:?})"); @@ -659,9 +659,29 @@ where postcard::from_bytes(observers_buf.as_ref().unwrap())?; fuzzer.process_execution(state, self, input, &observers, &exit_kind, true)? } else { - fuzzer.evaluate_input_with_observers::( - state, executor, self, input, true, - )? + let res = fuzzer.evaluate_input_with_observers::( + state, + executor, + self, + input.clone(), + false, + )?; + if res.1.is_some() { + self.inner.fire( + state, + Event::NewTestcase { + input, + client_config, + exit_kind, + corpus_size, + observers_buf, + time, + executions, + forward_id, + }, + )?; + } + res }; if let Some(item) = res.1 { log::info!("Added received Testcase as item #{item}"); diff --git a/libafl/src/events/llmp.rs b/libafl/src/events/llmp.rs index 3319bf8571..1866610870 100644 --- a/libafl/src/events/llmp.rs +++ b/libafl/src/events/llmp.rs @@ -240,7 +240,11 @@ where }; let client = monitor.client_stats_mut_for(id); client.update_corpus_size(*corpus_size as u64); - client.update_executions(*executions as u64, *time); + if id == client_id { + // do not update executions for forwarded messages, otherwise we loose the total order + // as a forwarded msg with a lower executions may arrive after a stats msg with an higher executions + client.update_executions(*executions as u64, *time); + } monitor.display(event.name().to_string(), id); Ok(BrokerEventResult::Forward) }