Fix libxml2 on fuzzbench (#2492)
* fix * fmt * fuck * from windows * fix --------- Co-authored-by: Your Name <you@example.com>
This commit is contained in:
parent
4b87d7f4eb
commit
f856092f3d
@ -31,7 +31,6 @@ use crate::{
|
|||||||
events::{EventFirer, EventRestarter},
|
events::{EventFirer, EventRestarter},
|
||||||
executors::{hooks::ExecutorHook, inprocess::HasInProcessHooks, Executor, HasObservers},
|
executors::{hooks::ExecutorHook, inprocess::HasInProcessHooks, Executor, HasObservers},
|
||||||
feedbacks::Feedback,
|
feedbacks::Feedback,
|
||||||
fuzzer::{ExecutionProcessor, HasScheduler},
|
|
||||||
inputs::UsesInput,
|
inputs::UsesInput,
|
||||||
state::{HasCorpus, HasExecutions, HasSolutions},
|
state::{HasCorpus, HasExecutions, HasSolutions},
|
||||||
Error, HasObjective,
|
Error, HasObjective,
|
||||||
@ -236,7 +235,7 @@ where
|
|||||||
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
||||||
OF: Feedback<E::State>,
|
OF: Feedback<E::State>,
|
||||||
E::State: HasExecutions + HasSolutions + HasCorpus,
|
E::State: HasExecutions + HasSolutions + HasCorpus,
|
||||||
Z: HasObjective<Objective = OF, State = E::State> + HasScheduler + ExecutionProcessor,
|
Z: HasObjective<Objective = OF, State = E::State>,
|
||||||
{
|
{
|
||||||
// # Safety
|
// # Safety
|
||||||
// We get a pointer to `GLOBAL_STATE` that will be initialized at this point in time.
|
// We get a pointer to `GLOBAL_STATE` that will be initialized at this point in time.
|
||||||
@ -276,7 +275,7 @@ where
|
|||||||
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
||||||
OF: Feedback<E::State>,
|
OF: Feedback<E::State>,
|
||||||
E::State: State + HasExecutions + HasSolutions + HasCorpus,
|
E::State: State + HasExecutions + HasSolutions + HasCorpus,
|
||||||
Z: HasObjective<Objective = OF, State = E::State> + HasScheduler + ExecutionProcessor,
|
Z: HasObjective<Objective = OF, State = E::State>,
|
||||||
{
|
{
|
||||||
let ret;
|
let ret;
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
|
@ -17,10 +17,9 @@ pub mod unix_signal_handler {
|
|||||||
Executor, ExitKind, HasObservers,
|
Executor, ExitKind, HasObservers,
|
||||||
},
|
},
|
||||||
feedbacks::Feedback,
|
feedbacks::Feedback,
|
||||||
fuzzer::{ExecutionProcessor, HasObjective},
|
fuzzer::HasObjective,
|
||||||
inputs::{Input, UsesInput},
|
inputs::{Input, UsesInput},
|
||||||
state::{HasCorpus, HasExecutions, HasSolutions},
|
state::{HasCorpus, HasExecutions, HasSolutions},
|
||||||
HasScheduler,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub(crate) type HandlerFuncPtr = unsafe fn(
|
pub(crate) type HandlerFuncPtr = unsafe fn(
|
||||||
@ -80,7 +79,7 @@ pub mod unix_signal_handler {
|
|||||||
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
||||||
OF: Feedback<E::State>,
|
OF: Feedback<E::State>,
|
||||||
E::State: HasExecutions + HasSolutions + HasCorpus,
|
E::State: HasExecutions + HasSolutions + HasCorpus,
|
||||||
Z: HasObjective<Objective = OF, State = E::State> + ExecutionProcessor + HasScheduler,
|
Z: HasObjective<Objective = OF, State = E::State>,
|
||||||
{
|
{
|
||||||
let old_hook = panic::take_hook();
|
let old_hook = panic::take_hook();
|
||||||
panic::set_hook(Box::new(move |panic_info| unsafe {
|
panic::set_hook(Box::new(move |panic_info| unsafe {
|
||||||
@ -127,7 +126,7 @@ pub mod unix_signal_handler {
|
|||||||
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
||||||
OF: Feedback<E::State>,
|
OF: Feedback<E::State>,
|
||||||
E::State: HasExecutions + HasSolutions + HasCorpus,
|
E::State: HasExecutions + HasSolutions + HasCorpus,
|
||||||
Z: HasObjective<Objective = OF, State = E::State> + ExecutionProcessor + HasScheduler,
|
Z: HasObjective<Objective = OF, State = E::State>,
|
||||||
{
|
{
|
||||||
// this stuff is for batch timeout
|
// this stuff is for batch timeout
|
||||||
if !data.executor_ptr.is_null()
|
if !data.executor_ptr.is_null()
|
||||||
@ -182,7 +181,7 @@ pub mod unix_signal_handler {
|
|||||||
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
||||||
OF: Feedback<E::State>,
|
OF: Feedback<E::State>,
|
||||||
E::State: HasExecutions + HasSolutions + HasCorpus,
|
E::State: HasExecutions + HasSolutions + HasCorpus,
|
||||||
Z: HasObjective<Objective = OF, State = E::State> + ExecutionProcessor + HasScheduler,
|
Z: HasObjective<Objective = OF, State = E::State>,
|
||||||
{
|
{
|
||||||
#[cfg(all(target_os = "android", target_arch = "aarch64"))]
|
#[cfg(all(target_os = "android", target_arch = "aarch64"))]
|
||||||
let _context = _context.map(|p| {
|
let _context = _context.map(|p| {
|
||||||
|
@ -18,7 +18,7 @@ pub mod windows_asan_handler {
|
|||||||
ExitKind, HasObservers,
|
ExitKind, HasObservers,
|
||||||
},
|
},
|
||||||
feedbacks::Feedback,
|
feedbacks::Feedback,
|
||||||
fuzzer::{ExecutionProcessor, HasObjective, HasScheduler},
|
fuzzer::HasObjective,
|
||||||
inputs::UsesInput,
|
inputs::UsesInput,
|
||||||
state::{HasCorpus, HasExecutions, HasSolutions},
|
state::{HasCorpus, HasExecutions, HasSolutions},
|
||||||
};
|
};
|
||||||
@ -31,7 +31,7 @@ pub mod windows_asan_handler {
|
|||||||
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
||||||
OF: Feedback<E::State>,
|
OF: Feedback<E::State>,
|
||||||
E::State: HasExecutions + HasSolutions + HasCorpus,
|
E::State: HasExecutions + HasSolutions + HasCorpus,
|
||||||
Z: HasObjective<Objective = OF, State = E::State> + HasScheduler + ExecutionProcessor,
|
Z: HasObjective<Objective = OF, State = E::State>,
|
||||||
{
|
{
|
||||||
let data = addr_of_mut!(GLOBAL_STATE);
|
let data = addr_of_mut!(GLOBAL_STATE);
|
||||||
(*data).set_in_handler(true);
|
(*data).set_in_handler(true);
|
||||||
@ -132,7 +132,7 @@ pub mod windows_exception_handler {
|
|||||||
Executor, ExitKind, HasObservers,
|
Executor, ExitKind, HasObservers,
|
||||||
},
|
},
|
||||||
feedbacks::Feedback,
|
feedbacks::Feedback,
|
||||||
fuzzer::{ExecutionProcessor, HasObjective, HasScheduler},
|
fuzzer::HasObjective,
|
||||||
inputs::{Input, UsesInput},
|
inputs::{Input, UsesInput},
|
||||||
state::{HasCorpus, HasExecutions, HasSolutions, State},
|
state::{HasCorpus, HasExecutions, HasSolutions, State},
|
||||||
};
|
};
|
||||||
@ -179,7 +179,7 @@ pub mod windows_exception_handler {
|
|||||||
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
||||||
OF: Feedback<E::State>,
|
OF: Feedback<E::State>,
|
||||||
E::State: HasExecutions + HasSolutions + HasCorpus,
|
E::State: HasExecutions + HasSolutions + HasCorpus,
|
||||||
Z: HasObjective<Objective = OF, State = E::State> + HasScheduler + ExecutionProcessor,
|
Z: HasObjective<Objective = OF, State = E::State>,
|
||||||
{
|
{
|
||||||
let old_hook = panic::take_hook();
|
let old_hook = panic::take_hook();
|
||||||
panic::set_hook(Box::new(move |panic_info| unsafe {
|
panic::set_hook(Box::new(move |panic_info| unsafe {
|
||||||
@ -239,7 +239,7 @@ pub mod windows_exception_handler {
|
|||||||
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
||||||
OF: Feedback<E::State>,
|
OF: Feedback<E::State>,
|
||||||
E::State: State + HasExecutions + HasSolutions + HasCorpus,
|
E::State: State + HasExecutions + HasSolutions + HasCorpus,
|
||||||
Z: HasObjective<Objective = OF, State = E::State> + HasScheduler + ExecutionProcessor,
|
Z: HasObjective<Objective = OF, State = E::State>,
|
||||||
{
|
{
|
||||||
let data: &mut InProcessExecutorHandlerData =
|
let data: &mut InProcessExecutorHandlerData =
|
||||||
&mut *(global_state as *mut InProcessExecutorHandlerData);
|
&mut *(global_state as *mut InProcessExecutorHandlerData);
|
||||||
@ -309,7 +309,7 @@ pub mod windows_exception_handler {
|
|||||||
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
||||||
OF: Feedback<E::State>,
|
OF: Feedback<E::State>,
|
||||||
E::State: HasExecutions + HasSolutions + HasCorpus,
|
E::State: HasExecutions + HasSolutions + HasCorpus,
|
||||||
Z: HasObjective<Objective = OF, State = E::State> + HasScheduler + ExecutionProcessor,
|
Z: HasObjective<Objective = OF, State = E::State>,
|
||||||
{
|
{
|
||||||
// Have we set a timer_before?
|
// Have we set a timer_before?
|
||||||
if data.ptp_timer.is_some() {
|
if data.ptp_timer.is_some() {
|
||||||
|
@ -26,11 +26,11 @@ use crate::{
|
|||||||
Executor, HasObservers,
|
Executor, HasObservers,
|
||||||
},
|
},
|
||||||
feedbacks::Feedback,
|
feedbacks::Feedback,
|
||||||
fuzzer::{HasObjective, HasScheduler},
|
fuzzer::HasObjective,
|
||||||
inputs::UsesInput,
|
inputs::UsesInput,
|
||||||
observers::{ObserversTuple, UsesObservers},
|
observers::{ObserversTuple, UsesObservers},
|
||||||
state::{HasCorpus, HasExecutions, HasSolutions, State, UsesState},
|
state::{HasCorpus, HasExecutions, HasSolutions, State, UsesState},
|
||||||
Error, ExecutionProcessor,
|
Error,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// The internal state of `GenericInProcessExecutor`.
|
/// The internal state of `GenericInProcessExecutor`.
|
||||||
@ -177,7 +177,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<S>,
|
OF: Feedback<S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S> + HasScheduler + ExecutionProcessor,
|
Z: HasObjective<Objective = OF, State = S>,
|
||||||
{
|
{
|
||||||
Self::with_timeout_generic::<E, EM, OF, Z>(
|
Self::with_timeout_generic::<E, EM, OF, Z>(
|
||||||
user_hooks,
|
user_hooks,
|
||||||
@ -204,7 +204,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<S>,
|
OF: Feedback<S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S> + HasScheduler + ExecutionProcessor,
|
Z: HasObjective<Objective = OF, State = S>,
|
||||||
{
|
{
|
||||||
let mut me = Self::with_timeout_generic::<E, EM, OF, Z>(
|
let mut me = Self::with_timeout_generic::<E, EM, OF, Z>(
|
||||||
user_hooks, observers, fuzzer, state, event_mgr, exec_tmout,
|
user_hooks, observers, fuzzer, state, event_mgr, exec_tmout,
|
||||||
@ -234,7 +234,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<S>,
|
OF: Feedback<S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S> + HasScheduler + ExecutionProcessor,
|
Z: HasObjective<Objective = OF, State = S>,
|
||||||
{
|
{
|
||||||
let default = InProcessHooks::new::<E, EM, OF, Z>(timeout)?;
|
let default = InProcessHooks::new::<E, EM, OF, Z>(timeout)?;
|
||||||
let mut hooks = tuple_list!(default).merge(user_hooks);
|
let mut hooks = tuple_list!(default).merge(user_hooks);
|
||||||
|
@ -21,7 +21,8 @@ use libafl_bolts::tuples::{tuple_list, RefIndexable};
|
|||||||
#[cfg(any(unix, feature = "std"))]
|
#[cfg(any(unix, feature = "std"))]
|
||||||
use crate::executors::hooks::inprocess::GLOBAL_STATE;
|
use crate::executors::hooks::inprocess::GLOBAL_STATE;
|
||||||
use crate::{
|
use crate::{
|
||||||
events::{EventFirer, EventRestarter},
|
corpus::{Corpus, Testcase},
|
||||||
|
events::{Event, EventFirer, EventRestarter},
|
||||||
executors::{
|
executors::{
|
||||||
hooks::{inprocess::InProcessHooks, ExecutorHooksTuple},
|
hooks::{inprocess::InProcessHooks, ExecutorHooksTuple},
|
||||||
inprocess::inner::GenericInProcessExecutorInner,
|
inprocess::inner::GenericInProcessExecutorInner,
|
||||||
@ -31,9 +32,8 @@ use crate::{
|
|||||||
fuzzer::HasObjective,
|
fuzzer::HasObjective,
|
||||||
inputs::UsesInput,
|
inputs::UsesInput,
|
||||||
observers::{ObserversTuple, UsesObservers},
|
observers::{ObserversTuple, UsesObservers},
|
||||||
schedulers::Scheduler,
|
state::{HasCorpus, HasCurrentTestcase, HasExecutions, HasSolutions, State, UsesState},
|
||||||
state::{HasCorpus, HasExecutions, HasSolutions, State, UsesState},
|
Error, ExecutionProcessor, HasMetadata, HasScheduler,
|
||||||
Error, ExecutionProcessor, HasScheduler,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// The inner structure of `InProcessExecutor`.
|
/// The inner structure of `InProcessExecutor`.
|
||||||
@ -180,7 +180,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<S>,
|
OF: Feedback<S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S> + HasScheduler + ExecutionProcessor,
|
Z: HasObjective<Objective = OF, State = S>,
|
||||||
{
|
{
|
||||||
Self::with_timeout_generic(
|
Self::with_timeout_generic(
|
||||||
tuple_list!(),
|
tuple_list!(),
|
||||||
@ -208,7 +208,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<S>,
|
OF: Feedback<S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S> + HasScheduler + ExecutionProcessor,
|
Z: HasObjective<Objective = OF, State = S>,
|
||||||
{
|
{
|
||||||
let inner = GenericInProcessExecutorInner::batched_timeout_generic::<Self, EM, OF, Z>(
|
let inner = GenericInProcessExecutorInner::batched_timeout_generic::<Self, EM, OF, Z>(
|
||||||
tuple_list!(),
|
tuple_list!(),
|
||||||
@ -247,7 +247,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<S>,
|
OF: Feedback<S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S> + HasScheduler + ExecutionProcessor,
|
Z: HasObjective<Objective = OF, State = S>,
|
||||||
{
|
{
|
||||||
let inner = GenericInProcessExecutorInner::with_timeout_generic::<Self, EM, OF, Z>(
|
let inner = GenericInProcessExecutorInner::with_timeout_generic::<Self, EM, OF, Z>(
|
||||||
tuple_list!(),
|
tuple_list!(),
|
||||||
@ -288,7 +288,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<S>,
|
OF: Feedback<S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S> + HasScheduler + ExecutionProcessor,
|
Z: HasObjective<Objective = OF, State = S>,
|
||||||
{
|
{
|
||||||
Self::with_timeout_generic(
|
Self::with_timeout_generic(
|
||||||
user_hooks,
|
user_hooks,
|
||||||
@ -317,7 +317,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<S>,
|
OF: Feedback<S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S> + HasScheduler + ExecutionProcessor,
|
Z: HasObjective<Objective = OF, State = S>,
|
||||||
{
|
{
|
||||||
let inner = GenericInProcessExecutorInner::batched_timeout_generic::<Self, EM, OF, Z>(
|
let inner = GenericInProcessExecutorInner::batched_timeout_generic::<Self, EM, OF, Z>(
|
||||||
user_hooks, observers, fuzzer, state, event_mgr, exec_tmout,
|
user_hooks, observers, fuzzer, state, event_mgr, exec_tmout,
|
||||||
@ -352,7 +352,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<S>,
|
OF: Feedback<S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S> + HasScheduler + ExecutionProcessor,
|
Z: HasObjective<Objective = OF, State = S>,
|
||||||
{
|
{
|
||||||
let inner = GenericInProcessExecutorInner::with_timeout_generic::<Self, EM, OF, Z>(
|
let inner = GenericInProcessExecutorInner::with_timeout_generic::<Self, EM, OF, Z>(
|
||||||
user_hooks, observers, fuzzer, state, event_mgr, timeout,
|
user_hooks, observers, fuzzer, state, event_mgr, timeout,
|
||||||
@ -431,47 +431,58 @@ pub fn run_observers_and_save_state<E, EM, OF, Z>(
|
|||||||
state: &mut E::State,
|
state: &mut E::State,
|
||||||
input: &<E::State as UsesInput>::Input,
|
input: &<E::State as UsesInput>::Input,
|
||||||
fuzzer: &mut Z,
|
fuzzer: &mut Z,
|
||||||
manager: &mut EM,
|
event_mgr: &mut EM,
|
||||||
exit_kind: ExitKind,
|
exitkind: ExitKind,
|
||||||
) where
|
) where
|
||||||
E: HasObservers,
|
E: HasObservers,
|
||||||
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
||||||
OF: Feedback<E::State>,
|
OF: Feedback<E::State>,
|
||||||
E::State: HasExecutions + HasSolutions + HasCorpus,
|
E::State: HasExecutions + HasSolutions + HasCorpus,
|
||||||
Z: HasObjective<Objective = OF, State = E::State>
|
Z: HasObjective<Objective = OF, State = E::State>,
|
||||||
+ HasScheduler<State = E::State>
|
|
||||||
+ ExecutionProcessor,
|
|
||||||
{
|
{
|
||||||
let observers = executor.observers_mut();
|
let mut observers = executor.observers_mut();
|
||||||
let scheduler = fuzzer.scheduler_mut();
|
|
||||||
|
|
||||||
if scheduler.on_evaluation(state, input, &*observers).is_err() {
|
observers
|
||||||
log::error!("Failed to call on_evaluation");
|
.post_exec_all(state, input, &exitkind)
|
||||||
return;
|
.expect("Observers post_exec_all failed");
|
||||||
}
|
|
||||||
|
|
||||||
let res = fuzzer.check_results(state, manager, input, &*observers, &exit_kind);
|
let interesting = fuzzer
|
||||||
if let Ok(exec_res) = res {
|
.objective_mut()
|
||||||
if fuzzer
|
.is_interesting(state, event_mgr, input, &*observers, &exitkind)
|
||||||
.process_execution(state, manager, input, &exec_res, &*observers)
|
.expect("In run_observers_and_save_state objective failure.");
|
||||||
.is_err()
|
|
||||||
{
|
if interesting {
|
||||||
log::error!("Failed to call process_execution");
|
let executions = *state.executions();
|
||||||
return;
|
let mut new_testcase = Testcase::with_executions(input.clone(), executions);
|
||||||
|
new_testcase.add_metadata(exitkind);
|
||||||
|
new_testcase.set_parent_id_optional(*state.corpus().current());
|
||||||
|
|
||||||
|
if let Ok(mut tc) = state.current_testcase_mut() {
|
||||||
|
tc.found_objective();
|
||||||
}
|
}
|
||||||
|
|
||||||
if fuzzer
|
fuzzer
|
||||||
.dispatch_event(state, manager, input.clone(), &exec_res, None, &exit_kind)
|
.objective_mut()
|
||||||
.is_err()
|
.append_metadata(state, event_mgr, &*observers, &mut new_testcase)
|
||||||
{
|
.expect("Failed adding metadata");
|
||||||
log::error!("Failed to dispatch_event");
|
state
|
||||||
return;
|
.solutions_mut()
|
||||||
}
|
.add(new_testcase)
|
||||||
} else {
|
.expect("In run_observers_and_save_state solutions failure.");
|
||||||
log::error!("Faild to check execution result");
|
event_mgr
|
||||||
|
.fire(
|
||||||
|
state,
|
||||||
|
Event::Objective {
|
||||||
|
objective_size: state.solutions().count(),
|
||||||
|
executions,
|
||||||
|
time: libafl_bolts::current_time(),
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.expect("Could not save state in run_observers_and_save_state");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Serialize the state and wait safely for the broker to read pending messages
|
// Serialize the state and wait safely for the broker to read pending messages
|
||||||
manager.on_restart(state).unwrap();
|
event_mgr.on_restart(state).unwrap();
|
||||||
|
|
||||||
log::info!("Bye!");
|
log::info!("Bye!");
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ use crate::{
|
|||||||
Executor, ExitKind, HasObservers,
|
Executor, ExitKind, HasObservers,
|
||||||
},
|
},
|
||||||
feedbacks::Feedback,
|
feedbacks::Feedback,
|
||||||
fuzzer::{ExecutionProcessor, HasObjective, HasScheduler},
|
fuzzer::HasObjective,
|
||||||
inputs::UsesInput,
|
inputs::UsesInput,
|
||||||
observers::{ObserversTuple, UsesObservers},
|
observers::{ObserversTuple, UsesObservers},
|
||||||
state::{HasCorpus, HasExecutions, HasSolutions, State, UsesState},
|
state::{HasCorpus, HasExecutions, HasSolutions, State, UsesState},
|
||||||
@ -172,7 +172,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<S>,
|
OF: Feedback<S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S> + HasScheduler + ExecutionProcessor,
|
Z: HasObjective<Objective = OF, State = S>,
|
||||||
{
|
{
|
||||||
Self::with_timeout_generic(
|
Self::with_timeout_generic(
|
||||||
tuple_list!(),
|
tuple_list!(),
|
||||||
@ -202,7 +202,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<S>,
|
OF: Feedback<S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S> + HasScheduler + ExecutionProcessor,
|
Z: HasObjective<Objective = OF, State = S>,
|
||||||
{
|
{
|
||||||
let inner = GenericInProcessExecutorInner::batched_timeout_generic::<Self, EM, OF, Z>(
|
let inner = GenericInProcessExecutorInner::batched_timeout_generic::<Self, EM, OF, Z>(
|
||||||
tuple_list!(),
|
tuple_list!(),
|
||||||
@ -243,7 +243,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<S>,
|
OF: Feedback<S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S> + HasScheduler + ExecutionProcessor,
|
Z: HasObjective<Objective = OF, State = S>,
|
||||||
{
|
{
|
||||||
let inner = GenericInProcessExecutorInner::with_timeout_generic::<Self, EM, OF, Z>(
|
let inner = GenericInProcessExecutorInner::with_timeout_generic::<Self, EM, OF, Z>(
|
||||||
tuple_list!(),
|
tuple_list!(),
|
||||||
@ -304,7 +304,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<S>,
|
OF: Feedback<S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S> + HasScheduler + ExecutionProcessor,
|
Z: HasObjective<Objective = OF, State = S>,
|
||||||
{
|
{
|
||||||
Self::with_timeout_generic(
|
Self::with_timeout_generic(
|
||||||
user_hooks,
|
user_hooks,
|
||||||
@ -335,7 +335,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<S>,
|
OF: Feedback<S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S> + HasScheduler + ExecutionProcessor,
|
Z: HasObjective<Objective = OF, State = S>,
|
||||||
{
|
{
|
||||||
let inner = GenericInProcessExecutorInner::batched_timeout_generic::<Self, EM, OF, Z>(
|
let inner = GenericInProcessExecutorInner::batched_timeout_generic::<Self, EM, OF, Z>(
|
||||||
user_hooks, observers, fuzzer, state, event_mgr, exec_tmout,
|
user_hooks, observers, fuzzer, state, event_mgr, exec_tmout,
|
||||||
@ -372,7 +372,7 @@ where
|
|||||||
EM: EventFirer<State = S> + EventRestarter,
|
EM: EventFirer<State = S> + EventRestarter,
|
||||||
OF: Feedback<S>,
|
OF: Feedback<S>,
|
||||||
S: State,
|
S: State,
|
||||||
Z: HasObjective<Objective = OF, State = S> + HasScheduler + ExecutionProcessor,
|
Z: HasObjective<Objective = OF, State = S>,
|
||||||
{
|
{
|
||||||
let inner = GenericInProcessExecutorInner::with_timeout_generic::<Self, EM, OF, Z>(
|
let inner = GenericInProcessExecutorInner::with_timeout_generic::<Self, EM, OF, Z>(
|
||||||
user_hooks, observers, fuzzer, state, event_mgr, timeout,
|
user_hooks, observers, fuzzer, state, event_mgr, timeout,
|
||||||
|
@ -83,7 +83,7 @@ pub unsafe fn inproc_qemu_timeout_handler<E, EM, OF, Z>(
|
|||||||
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
||||||
OF: Feedback<E::State>,
|
OF: Feedback<E::State>,
|
||||||
E::State: HasExecutions + HasSolutions + HasCorpus,
|
E::State: HasExecutions + HasSolutions + HasCorpus,
|
||||||
Z: HasObjective<Objective = OF, State = E::State> + ExecutionProcessor + HasScheduler,
|
Z: HasObjective<Objective = OF, State = E::State>,
|
||||||
{
|
{
|
||||||
if BREAK_ON_TMOUT {
|
if BREAK_ON_TMOUT {
|
||||||
qemu_system_debug_request();
|
qemu_system_debug_request();
|
||||||
|
@ -5,7 +5,11 @@
|
|||||||
use core::simd::num::SimdUint;
|
use core::simd::num::SimdUint;
|
||||||
use core::{mem::align_of, slice};
|
use core::{mem::align_of, slice};
|
||||||
|
|
||||||
#[cfg(any(feature = "sancov_ngram4", feature = "sancov_ctx", feature = "sancov_ngram8"))]
|
#[cfg(any(
|
||||||
|
feature = "sancov_ngram4",
|
||||||
|
feature = "sancov_ctx",
|
||||||
|
feature = "sancov_ngram8"
|
||||||
|
))]
|
||||||
use libafl::executors::{hooks::ExecutorHook, HasObservers};
|
use libafl::executors::{hooks::ExecutorHook, HasObservers};
|
||||||
|
|
||||||
#[cfg(any(
|
#[cfg(any(
|
||||||
|
@ -5,7 +5,7 @@ use libafl::{
|
|||||||
executors::{hooks::windows::windows_asan_handler::asan_death_handler, Executor, HasObservers},
|
executors::{hooks::windows::windows_asan_handler::asan_death_handler, Executor, HasObservers},
|
||||||
feedbacks::Feedback,
|
feedbacks::Feedback,
|
||||||
state::{HasCorpus, HasExecutions, HasSolutions},
|
state::{HasCorpus, HasExecutions, HasSolutions},
|
||||||
ExecutionProcessor, HasObjective, HasScheduler,
|
HasObjective,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Asan death callback type
|
/// Asan death callback type
|
||||||
@ -33,7 +33,7 @@ where
|
|||||||
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
EM: EventFirer<State = E::State> + EventRestarter<State = E::State>,
|
||||||
OF: Feedback<E::State>,
|
OF: Feedback<E::State>,
|
||||||
E::State: HasSolutions + HasCorpus + HasExecutions,
|
E::State: HasSolutions + HasCorpus + HasExecutions,
|
||||||
Z: HasObjective<Objective = OF, State = E::State> + HasScheduler + ExecutionProcessor,
|
Z: HasObjective<Objective = OF, State = E::State>,
|
||||||
{
|
{
|
||||||
__sanitizer_set_death_callback(Some(asan_death_handler::<E, EM, OF, Z>));
|
__sanitizer_set_death_callback(Some(asan_death_handler::<E, EM, OF, Z>));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user