Forkserver_simple uses TimeoutForkserverExecutor (#139)
* forkserver_simple uses TimeoutforkserverExecutor * fmt * from_millis
This commit is contained in:
parent
e68eaf8244
commit
e4b3cc542a
@ -1,5 +1,4 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use core::time::Duration;
|
||||
use libafl::{
|
||||
bolts::{
|
||||
current_nanos,
|
||||
@ -12,7 +11,7 @@ use libafl::{
|
||||
QueueCorpusScheduler,
|
||||
},
|
||||
events::SimpleEventManager,
|
||||
executors::forkserver::ForkserverExecutor,
|
||||
executors::forkserver::{ForkserverExecutor, TimeoutForkserverExecutor},
|
||||
feedback_and, feedback_or,
|
||||
feedbacks::{CrashFeedback, MapFeedbackState, MaxMapFeedback, TimeFeedback},
|
||||
fuzzer::{Fuzzer, StdFuzzer},
|
||||
@ -23,6 +22,7 @@ use libafl::{
|
||||
state::{HasCorpus, StdState},
|
||||
stats::SimpleStats,
|
||||
};
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[allow(clippy::similar_names)]
|
||||
pub fn main() {
|
||||
@ -96,12 +96,16 @@ pub fn main() {
|
||||
let mut fuzzer = StdFuzzer::new(scheduler, feedback, objective);
|
||||
|
||||
// Create the executor for the forkserver
|
||||
let mut executor = ForkserverExecutor::new(
|
||||
let mut executor = TimeoutForkserverExecutor::new(
|
||||
ForkserverExecutor::new(
|
||||
"../../libafl_tests/src/forkserver_test.o".to_string(),
|
||||
&[],
|
||||
tuple_list!(edges_observer, time_observer),
|
||||
)
|
||||
.expect("Failed to create the Executor");
|
||||
.unwrap(),
|
||||
Duration::from_millis(5000),
|
||||
)
|
||||
.expect("Failed to create the executor.");
|
||||
|
||||
// In case the corpus is empty (on first run), reset
|
||||
if state.corpus().count() < 1 {
|
||||
|
@ -389,8 +389,8 @@ where
|
||||
|
||||
// We need to kill the child in case he has timed out, or we can't get the correct pid in the next call to self.executor.forkserver_mut().read_st()?
|
||||
kill(self.executor.forkserver().child_pid(), Signal::SIGKILL)?;
|
||||
let (recv_status_len, exit_code) = self.executor.forkserver_mut().read_st()?;
|
||||
if recv_status_len != 4 || exit_code != 9 {
|
||||
let (recv_status_len, _) = self.executor.forkserver_mut().read_st()?;
|
||||
if recv_status_len != 4 {
|
||||
return Err(Error::Forkserver(
|
||||
"Could not kill timed-out child".to_string(),
|
||||
));
|
||||
|
Loading…
x
Reference in New Issue
Block a user