From 36e5fe43b1d25f62ecbc62693a6de9949abff681 Mon Sep 17 00:00:00 2001 From: toka Date: Mon, 25 Mar 2024 17:45:01 +0100 Subject: [PATCH 1/4] increase timeout & print pid for logger --- libafl_bolts/src/lib.rs | 9 ++++++--- libafl_bolts/src/llmp.rs | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/libafl_bolts/src/lib.rs b/libafl_bolts/src/lib.rs index 49cc417308..d1d40e536c 100644 --- a/libafl_bolts/src/lib.rs +++ b/libafl_bolts/src/lib.rs @@ -872,8 +872,9 @@ impl log::Log for SimpleStdoutLogger { fn log(&self, record: &Record) { println!( - "[{:?}] {}: {}", + "[{:?}, {:?}] {}: {}", current_time(), + std::process::id(), record.level(), record.args() ); @@ -918,8 +919,9 @@ impl log::Log for SimpleStderrLogger { fn log(&self, record: &Record) { eprintln!( - "[{:?}] {}: {}", + "[{:?}, {:?}] {}: {}", current_time(), + std::process::id(), record.level(), record.args() ); @@ -982,8 +984,9 @@ impl log::Log for SimpleFdLogger { let mut f = unsafe { File::from_raw_fd(self.fd) }; writeln!( f, - "[{:?}] {}: {}", + "[{:?}, {:#?}] {}: {}", current_time(), + std::process::id(), record.level(), record.args() ) diff --git a/libafl_bolts/src/llmp.rs b/libafl_bolts/src/llmp.rs index e983c76892..6137ddb92e 100644 --- a/libafl_bolts/src/llmp.rs +++ b/libafl_bolts/src/llmp.rs @@ -105,7 +105,7 @@ use crate::{ }; /// The default timeout in seconds after which a client will be considered stale, and removed. -pub const DEFAULT_CLIENT_TIMEOUT_SECS: Duration = Duration::from_secs(300); +pub const DEFAULT_CLIENT_TIMEOUT_SECS: Duration = Duration::from_secs(7200); /// The max number of pages a [`client`] may have mapped that were not yet read by the [`broker`] /// Usually, this value should not exceed `1`, else the broker cannot keep up with the amount of incoming messages. From 905daf7cf27876020802fca966459aacbf3248c8 Mon Sep 17 00:00:00 2001 From: toka Date: Mon, 25 Mar 2024 17:48:58 +0100 Subject: [PATCH 2/4] log --- libafl/src/fuzzer/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libafl/src/fuzzer/mod.rs b/libafl/src/fuzzer/mod.rs index 492aa019cc..76d52ee743 100644 --- a/libafl/src/fuzzer/mod.rs +++ b/libafl/src/fuzzer/mod.rs @@ -180,6 +180,7 @@ where ) -> Result<(), Error> { let monitor_timeout = STATS_TIMEOUT_DEFAULT; loop { + log::info!("Starting another fuzz_loop"); manager.maybe_report_progress(state, monitor_timeout)?; self.fuzz_one(stages, executor, state, manager)?; } @@ -212,6 +213,7 @@ where let monitor_timeout = STATS_TIMEOUT_DEFAULT; for _ in 0..iters { + log::info!("Starting another fuzz_loop"); manager.maybe_report_progress(state, monitor_timeout)?; ret = Some(self.fuzz_one(stages, executor, state, manager)?); } From bcea8c284a5aca926feee6338469125a1eff0be2 Mon Sep 17 00:00:00 2001 From: toka Date: Mon, 25 Mar 2024 18:04:00 +0100 Subject: [PATCH 3/4] aa --- libafl/src/fuzzer/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libafl/src/fuzzer/mod.rs b/libafl/src/fuzzer/mod.rs index 76d52ee743..7f7c491a7d 100644 --- a/libafl/src/fuzzer/mod.rs +++ b/libafl/src/fuzzer/mod.rs @@ -180,7 +180,7 @@ where ) -> Result<(), Error> { let monitor_timeout = STATS_TIMEOUT_DEFAULT; loop { - log::info!("Starting another fuzz_loop"); + // log::info!("Starting another fuzz_loop"); manager.maybe_report_progress(state, monitor_timeout)?; self.fuzz_one(stages, executor, state, manager)?; } @@ -213,7 +213,7 @@ where let monitor_timeout = STATS_TIMEOUT_DEFAULT; for _ in 0..iters { - log::info!("Starting another fuzz_loop"); + // log::info!("Starting another fuzz_loop"); manager.maybe_report_progress(state, monitor_timeout)?; ret = Some(self.fuzz_one(stages, executor, state, manager)?); } From 445ac600311d1e4b03936c74e2d18cd7c89fd1e9 Mon Sep 17 00:00:00 2001 From: toka Date: Mon, 25 Mar 2024 18:31:38 +0100 Subject: [PATCH 4/4] rename stuff --- libafl/src/events/llmp.rs | 3 ++- libafl/src/events/mod.rs | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libafl/src/events/llmp.rs b/libafl/src/events/llmp.rs index 206d4d1685..cf54e2cfb0 100644 --- a/libafl/src/events/llmp.rs +++ b/libafl/src/events/llmp.rs @@ -205,7 +205,7 @@ where Ok(llmp::LlmpMsgHookResult::ForwardToClients) } } else { - monitor.display("Broker", ClientId(0)); + monitor.display("Broker Heartbeat", ClientId(0)); Ok(llmp::LlmpMsgHookResult::Handled) } }, @@ -249,6 +249,7 @@ where 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 + // this also means when you wrap this event manger with centralized EM, you will **NOT** get executions update with the new tc message client.update_executions(*executions, *time); } monitor.display(event.name(), id); diff --git a/libafl/src/events/mod.rs b/libafl/src/events/mod.rs index f97ef86442..345f5f1ece 100644 --- a/libafl/src/events/mod.rs +++ b/libafl/src/events/mod.rs @@ -386,12 +386,12 @@ where time: _, executions: _, phantom: _, - } - | Event::UpdateUserStats { + } => "Client Heartbeat", + Event::UpdateUserStats { name: _, value: _, phantom: _, - } => "Stats", + } => "UserStats", #[cfg(feature = "introspection")] Event::UpdatePerfMonitor { time: _,