Fix main not passing CI tests (#2075)

* Fix sancov import

* fmt

* fmt
This commit is contained in:
Romain Malmain 2024-04-18 13:33:18 +02:00 committed by GitHub
parent 886519b10c
commit 39c32d55e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 15 additions and 20 deletions

View File

@ -146,11 +146,9 @@ pub fn main() {
.unwrap(); .unwrap();
// The Monitor trait define how the fuzzer stats are reported to the user // The Monitor trait define how the fuzzer stats are reported to the user
let monitor = SimpleMonitor::with_user_monitor( let monitor = SimpleMonitor::with_user_monitor(|s| {
|s| {
println!("{s}"); println!("{s}");
} });
);
// The event manager handle the various events generated during the fuzzing loop // The event manager handle the various events generated during the fuzzing loop
// such as the notification of the addition of a new item to the corpus // such as the notification of the addition of a new item to the corpus

View File

@ -198,15 +198,13 @@ fn fuzz(
let file_null = File::open("/dev/null")?; let file_null = File::open("/dev/null")?;
// 'While the stats are state, they are usually used in the broker - which is likely never restarted // 'While the stats are state, they are usually used in the broker - which is likely never restarted
let monitor = SimpleMonitor::with_user_monitor( let monitor = SimpleMonitor::with_user_monitor(|s| {
|s| {
#[cfg(unix)] #[cfg(unix)]
writeln!(&mut stdout_cpy, "{s}").unwrap(); writeln!(&mut stdout_cpy, "{s}").unwrap();
#[cfg(windows)] #[cfg(windows)]
println!("{s}"); println!("{s}");
writeln!(log.borrow_mut(), "{:?} {s}", current_time()).unwrap(); writeln!(log.borrow_mut(), "{:?} {s}", current_time()).unwrap();
} });
);
let mut shmem_provider = StdShMemProvider::new()?; let mut shmem_provider = StdShMemProvider::new()?;

View File

@ -142,11 +142,9 @@ pub fn fuzz() -> Result<(), Error> {
let mut shmem_provider = StdShMemProvider::new().expect("Failed to init shared memory"); let mut shmem_provider = StdShMemProvider::new().expect("Failed to init shared memory");
let monitor = SimpleMonitor::with_user_monitor( let monitor = SimpleMonitor::with_user_monitor(|s| {
|s| {
println!("{s}"); println!("{s}");
} });
);
let (state, mut mgr) = match SimpleRestartingEventManager::launch(monitor, &mut shmem_provider) let (state, mut mgr) = match SimpleRestartingEventManager::launch(monitor, &mut shmem_provider)
{ {
Ok(res) => res, Ok(res) => res,

View File

@ -11,7 +11,8 @@ use libafl::executors::{hooks::ExecutorHook, HasObservers};
#[cfg(any( #[cfg(any(
feature = "pointer_maps", feature = "pointer_maps",
feature = "sancov_pcguard_edges", feature = "sancov_pcguard_edges",
feature = "sancov_pcguard_hitcounts" feature = "sancov_pcguard_hitcounts",
feature = "sancov_ctx",
))] ))]
use crate::coverage::EDGES_MAP; use crate::coverage::EDGES_MAP;
use crate::coverage::MAX_EDGES_NUM; use crate::coverage::MAX_EDGES_NUM;