diff --git a/fuzzers/FRET/Cargo.toml b/fuzzers/FRET/Cargo.toml index d42c2d9312..c72e739e39 100644 --- a/fuzzers/FRET/Cargo.toml +++ b/fuzzers/FRET/Cargo.toml @@ -10,6 +10,7 @@ std = [] snapshot_restore = [] snapshot_fast = [ "snapshot_restore" ] singlecore = [] +restarting = ['singlecore'] trace_abbs = [] systemstate = [] feed_systemgraph = [ "systemstate" ] @@ -30,4 +31,4 @@ serde = { version = "1.0", default-features = false, features = ["alloc"] } # se hashbrown = { version = "0.12", features = ["serde", "ahash-compile-time-rng"] } # A faster hashmap, nostd compatible petgraph = { version="0.6.0", features = ["serde-1"] } ron = "0.7" # write serialized data - including hashmaps -rand = "0.5" \ No newline at end of file +rand = "0.5" diff --git a/fuzzers/FRET/src/fuzzer.rs b/fuzzers/FRET/src/fuzzer.rs index c3da007b39..637ddfb6f4 100644 --- a/fuzzers/FRET/src/fuzzer.rs +++ b/fuzzers/FRET/src/fuzzer.rs @@ -508,24 +508,30 @@ pub fn fuzz() { #[cfg(feature = "singlecore")] { let monitor = SimpleMonitor::new(|s| println!("{}", s)); - // let mgr = SimpleEventManager::new(monitor); - // run_client(None, mgr, 0); - - let mut shmem_provider = StdShMemProvider::new().unwrap(); - let (state, mut mgr) = match SimpleRestartingEventManager::launch(monitor, &mut shmem_provider) + #[cfg(not(feature = "restarting"))] { - // The restarting state will spawn the same process again as child, then restarted it each time it crashes. - Ok(res) => res, - Err(err) => match err { - Error::ShuttingDown => { - return; - } - _ => { - panic!("Failed to setup the restarter: {}", err); - } - }, - }; - run_client(state, mgr, 0); + let mgr = SimpleEventManager::new(monitor); + run_client(None, mgr, 0); + } + + #[cfg(feature = "restarting")] + { + let mut shmem_provider = StdShMemProvider::new().unwrap(); + let (state, mut mgr) = match SimpleRestartingEventManager::launch(monitor, &mut shmem_provider) + { + // The restarting state will spawn the same process again as child, then restarted it each time it crashes. + Ok(res) => res, + Err(err) => match err { + Error::ShuttingDown => { + return; + } + _ => { + panic!("Failed to setup the restarter: {}", err); + } + }, + }; + run_client(state, mgr, 0); + } } // else -> multicore #[cfg(not(feature = "singlecore"))] @@ -553,4 +559,4 @@ pub fn fuzz() { Err(err) => panic!("Failed to run launcher: {:?}", err), } } -} \ No newline at end of file +}