Qemu launcher bugfix (#2858)
* Fixed the issue where compilation failed under the simplemgr configuration. * Fixed the issue where the crash handler would fail during rerun. * update fmt --------- Co-authored-by: h1k0 <h1k0naka@outlook.com>
This commit is contained in:
parent
a949452453
commit
9a64a53d12
@ -9,10 +9,9 @@ use libafl::{
|
||||
Error,
|
||||
};
|
||||
use libafl_bolts::{rands::StdRand, tuples::tuple_list};
|
||||
#[cfg(feature = "injections")]
|
||||
use libafl_qemu::modules::injections::InjectionModule;
|
||||
use libafl_qemu::modules::{
|
||||
asan::AsanModule, asan_guest::AsanGuestModule, cmplog::CmpLogModule, DrCovModule,
|
||||
InjectionModule,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
@ -75,7 +74,7 @@ impl Client<'_> {
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "injections"))]
|
||||
let injection_module = None;
|
||||
let injection_module = Option::<InjectionModule>::None;
|
||||
|
||||
#[cfg(feature = "injections")]
|
||||
let injection_module = self
|
||||
@ -95,10 +94,14 @@ impl Client<'_> {
|
||||
|
||||
let is_cmplog = self.options.is_cmplog_core(core_id);
|
||||
|
||||
let extra_tokens = injection_module
|
||||
let extra_tokens = if cfg!(feature = "injections") {
|
||||
injection_module
|
||||
.as_ref()
|
||||
.map(|h| h.tokens.clone())
|
||||
.unwrap_or_default();
|
||||
.unwrap_or_default()
|
||||
} else {
|
||||
Vec::new()
|
||||
};
|
||||
|
||||
let instance_builder = Instance::builder()
|
||||
.options(self.options)
|
||||
|
@ -129,7 +129,11 @@ impl Fuzzer {
|
||||
}
|
||||
|
||||
#[cfg(feature = "simplemgr")]
|
||||
return client.run(None, SimpleEventManager::new(monitor), CoreId(0));
|
||||
return client.run(
|
||||
None,
|
||||
SimpleEventManager::new(monitor),
|
||||
ClientDescription::new(0, 0, CoreId(0)),
|
||||
);
|
||||
|
||||
// Build and run the Launcher / fuzzer.
|
||||
#[cfg(not(feature = "simplemgr"))]
|
||||
|
@ -55,7 +55,7 @@ pub type ClientState =
|
||||
StdState<InMemoryOnDiskCorpus<BytesInput>, BytesInput, StdRand, OnDiskCorpus<BytesInput>>;
|
||||
|
||||
#[cfg(feature = "simplemgr")]
|
||||
pub type ClientMgr<M> = SimpleEventManager<M, ClientState>;
|
||||
pub type ClientMgr<M> = SimpleEventManager<BytesInput, M, ClientState>;
|
||||
#[cfg(not(feature = "simplemgr"))]
|
||||
pub type ClientMgr<M> = MonitorTypedEventManager<
|
||||
LlmpRestartingEventManager<(), BytesInput, ClientState, StdShMemProvider>,
|
||||
@ -242,12 +242,7 @@ impl<M: Monitor> Instance<'_, M> {
|
||||
)?;
|
||||
|
||||
executor
|
||||
.run_target(
|
||||
&mut NopFuzzer::new(),
|
||||
&mut state,
|
||||
&mut NopEventManager::new(),
|
||||
&input,
|
||||
)
|
||||
.run_target(&mut fuzzer, &mut state, &mut self.mgr, &input)
|
||||
.expect("Error running target");
|
||||
// We're done :)
|
||||
process::exit(0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user