pub struct SimpleRestartingEventManager<I, MT, S, SP>where
I: Input,
SP: ShMemProvider,
MT: Monitor + Debug,{ /* private fields */ }
Expand description
Provides a builder
which can be used to build a SimpleRestartingEventManager
, which is a combination of a
restarter
and runner
, that can be used on systems both with and without fork
support. The
restarter
will start a new process each time the child crashes or times out.
Implementations
sourceimpl<I, MT, S, SP> SimpleRestartingEventManager<I, MT, S, SP>where
I: Input,
SP: ShMemProvider,
MT: Monitor + Debug,
impl<I, MT, S, SP> SimpleRestartingEventManager<I, MT, S, SP>where
I: Input,
SP: ShMemProvider,
MT: Monitor + Debug,
sourcepub fn launch(
monitor: MT,
shmem_provider: &mut SP
) -> Result<(Option<S>, Self), Error>where
S: DeserializeOwned + Serialize + HasCorpus<I> + HasSolutions<I>,
MT: Debug,
pub fn launch(
monitor: MT,
shmem_provider: &mut SP
) -> Result<(Option<S>, Self), Error>where
S: DeserializeOwned + Serialize + HasCorpus<I> + HasSolutions<I>,
MT: Debug,
Launch the simple restarting manager.
This EventManager
is simple and single threaded,
but can still used shared maps to recover from crashes and timeouts.
Trait Implementations
sourceimpl<I: Debug, MT: Debug, S: Debug, SP: Debug> Debug for SimpleRestartingEventManager<I, MT, S, SP>where
I: Input,
SP: ShMemProvider,
MT: Monitor + Debug,
impl<I: Debug, MT: Debug, S: Debug, SP: Debug> Debug for SimpleRestartingEventManager<I, MT, S, SP>where
I: Input,
SP: ShMemProvider,
MT: Monitor + Debug,
sourceimpl<I, MT, S, SP> EventFirer<I> for SimpleRestartingEventManager<I, MT, S, SP>where
I: Input,
SP: ShMemProvider,
MT: Monitor + Debug,
impl<I, MT, S, SP> EventFirer<I> for SimpleRestartingEventManager<I, MT, S, SP>where
I: Input,
SP: ShMemProvider,
MT: Monitor + Debug,
sourcefn log<S>(
&mut self,
state: &mut S,
severity_level: LogSeverity,
message: String
) -> Result<(), Error>
fn log<S>(
&mut self,
state: &mut S,
severity_level: LogSeverity,
message: String
) -> Result<(), Error>
Send off an
Event::Log
event to the broker.
This is a shortcut for EventFirer::fire
with Event::Log
as argument. Read moresourcefn serialize_observers<OT, S>(
&mut self,
observers: &OT
) -> Result<Vec<u8>, Error>where
OT: ObserversTuple<I, S> + Serialize,
fn serialize_observers<OT, S>(
&mut self,
observers: &OT
) -> Result<Vec<u8>, Error>where
OT: ObserversTuple<I, S> + Serialize,
Serialize all observers for this type and manager
sourcefn configuration(&self) -> EventConfig
fn configuration(&self) -> EventConfig
Get the configuration
sourceimpl<E, I, S, SP, MT, Z> EventProcessor<E, I, S, Z> for SimpleRestartingEventManager<I, MT, S, SP>where
I: Input,
S: Serialize,
SP: ShMemProvider,
MT: Monitor + Debug,
impl<E, I, S, SP, MT, Z> EventProcessor<E, I, S, Z> for SimpleRestartingEventManager<I, MT, S, SP>where
I: Input,
S: Serialize,
SP: ShMemProvider,
MT: Monitor + Debug,
sourcefn process(
&mut self,
fuzzer: &mut Z,
state: &mut S,
executor: &mut E
) -> Result<usize, Error>
fn process(
&mut self,
fuzzer: &mut Z,
state: &mut S,
executor: &mut E
) -> Result<usize, Error>
Lookup for incoming events and process them.
Return the number of processes events or an error Read more
sourcefn deserialize_observers<OT>(
&mut self,
observers_buf: &[u8]
) -> Result<OT, Error>where
OT: ObserversTuple<I, S> + DeserializeOwned,
fn deserialize_observers<OT>(
&mut self,
observers_buf: &[u8]
) -> Result<OT, Error>where
OT: ObserversTuple<I, S> + DeserializeOwned,
Deserialize all observers for this type and manager
sourceimpl<I, MT, S, SP> EventRestarter<S> for SimpleRestartingEventManager<I, MT, S, SP>where
I: Input,
S: Serialize,
SP: ShMemProvider,
MT: Monitor + Debug,
impl<I, MT, S, SP> EventRestarter<S> for SimpleRestartingEventManager<I, MT, S, SP>where
I: Input,
S: Serialize,
SP: ShMemProvider,
MT: Monitor + Debug,
sourcefn on_restart(&mut self, state: &mut S) -> Result<(), Error>
fn on_restart(&mut self, state: &mut S) -> Result<(), Error>
Reset the single page (we reuse it over and over from pos 0), then send the current state to the next runner.
sourcefn await_restart_safe(&mut self)
fn await_restart_safe(&mut self)
Block until we are safe to exit.
sourceimpl<I, MT, S, SP> HasCustomBufHandlers<S> for SimpleRestartingEventManager<I, MT, S, SP>where
I: Input,
SP: ShMemProvider,
MT: Monitor + Debug,
impl<I, MT, S, SP> HasCustomBufHandlers<S> for SimpleRestartingEventManager<I, MT, S, SP>where
I: Input,
SP: ShMemProvider,
MT: Monitor + Debug,
sourcefn add_custom_buf_handler(
&mut self,
handler: Box<dyn FnMut(&mut S, &String, &[u8]) -> Result<CustomBufEventResult, Error>>
)
fn add_custom_buf_handler(
&mut self,
handler: Box<dyn FnMut(&mut S, &String, &[u8]) -> Result<CustomBufEventResult, Error>>
)
Adds a custom buffer handler that will run for each incoming
CustomBuf
event.sourceimpl<I, MT, S, SP> HasEventManagerId for SimpleRestartingEventManager<I, MT, S, SP>where
I: Input,
SP: ShMemProvider,
MT: Monitor + Debug,
impl<I, MT, S, SP> HasEventManagerId for SimpleRestartingEventManager<I, MT, S, SP>where
I: Input,
SP: ShMemProvider,
MT: Monitor + Debug,
sourcefn mgr_id(&self) -> EventManagerId
fn mgr_id(&self) -> EventManagerId
The id of this manager. For Multiprocessed
EventManager
s,
each client should have a unique ids. Read moresourceimpl<I, MT, S, SP> ProgressReporter<I> for SimpleRestartingEventManager<I, MT, S, SP>where
I: Input,
SP: ShMemProvider,
MT: Monitor + Debug,
impl<I, MT, S, SP> ProgressReporter<I> for SimpleRestartingEventManager<I, MT, S, SP>where
I: Input,
SP: ShMemProvider,
MT: Monitor + Debug,
sourcefn maybe_report_progress<S>(
&mut self,
state: &mut S,
last_report_time: Duration,
monitor_timeout: Duration
) -> Result<Duration, Error>where
S: HasExecutions + HasClientPerfMonitor + HasMetadata,
fn maybe_report_progress<S>(
&mut self,
state: &mut S,
last_report_time: Duration,
monitor_timeout: Duration
) -> Result<Duration, Error>where
S: HasExecutions + HasClientPerfMonitor + HasMetadata,
Given the last time, if
monitor_timeout
seconds passed, send off an info/monitor/heartbeat message to the broker.
Returns the new last
time (so the old one, unless monitor_timeout
time has passed and monitor have been sent)
Will return an crate::Error
, if the stats could not be sent. Read moreimpl<E, I, S, SP, MT, Z> EventManager<E, I, S, Z> for SimpleRestartingEventManager<I, MT, S, SP>where
E: Executor<Self, I, S, Z>,
I: Input,
S: Serialize,
SP: ShMemProvider,
MT: Monitor + Debug,
Auto Trait Implementations
impl<I, MT, S, SP> !RefUnwindSafe for SimpleRestartingEventManager<I, MT, S, SP>
impl<I, MT, S, SP> !Send for SimpleRestartingEventManager<I, MT, S, SP>
impl<I, MT, S, SP> !Sync for SimpleRestartingEventManager<I, MT, S, SP>
impl<I, MT, S, SP> Unpin for SimpleRestartingEventManager<I, MT, S, SP>where
I: Unpin,
MT: Unpin,
S: Unpin,
<SP as ShMemProvider>::ShMem: Unpin,
impl<I, MT, S, SP> !UnwindSafe for SimpleRestartingEventManager<I, MT, S, SP>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Tail, T> Prepend<T> for Tail
impl<Tail, T> Prepend<T> for Tail
type PreprendResult = Tail
type PreprendResult = Tail
sourcefn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)
fn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)
Prepend a value to this tuple, returning a new tuple with prepended value.