Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase llmp timeout & Print PID in logger #1970

Merged
merged 5 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion libafl/src/events/llmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
},
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions libafl/src/events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: _,
Expand Down
2 changes: 2 additions & 0 deletions libafl/src/fuzzer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
}
Expand Down Expand Up @@ -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)?);
}
Expand Down
9 changes: 6 additions & 3 deletions libafl_bolts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -872,8 +872,9 @@ impl log::Log for SimpleStdoutLogger {

fn log(&self, record: &Record) {
println!(
"[{:?}] {}: {}",
"[{:?}, {:?}] {}: {}",
current_time(),
std::process::id(),
record.level(),
record.args()
);
Expand Down Expand Up @@ -918,8 +919,9 @@ impl log::Log for SimpleStderrLogger {

fn log(&self, record: &Record) {
eprintln!(
"[{:?}] {}: {}",
"[{:?}, {:?}] {}: {}",
current_time(),
std::process::id(),
record.level(),
record.args()
);
Expand Down Expand Up @@ -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()
)
Expand Down
2 changes: 1 addition & 1 deletion libafl_bolts/src/llmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading