Use InMemoryOnDiskCorpus in fuzzbench fuzzer (#1240)
* in memory * f * aaa * nn
This commit is contained in:
parent
95d1069393
commit
c8fad7833d
@ -24,7 +24,7 @@ use libafl::{
|
|||||||
tuples::{tuple_list, Merge},
|
tuples::{tuple_list, Merge},
|
||||||
AsSlice,
|
AsSlice,
|
||||||
},
|
},
|
||||||
corpus::{Corpus, OnDiskCorpus},
|
corpus::{Corpus, InMemoryOnDiskCorpus, OnDiskCorpus},
|
||||||
events::SimpleRestartingEventManager,
|
events::SimpleRestartingEventManager,
|
||||||
executors::{inprocess::InProcessExecutor, ExitKind, TimeoutExecutor},
|
executors::{inprocess::InProcessExecutor, ExitKind, TimeoutExecutor},
|
||||||
feedback_or,
|
feedback_or,
|
||||||
@ -271,7 +271,7 @@ fn fuzz(
|
|||||||
// RNG
|
// RNG
|
||||||
StdRand::with_seed(current_nanos()),
|
StdRand::with_seed(current_nanos()),
|
||||||
// Corpus that will be evolved, we keep it in memory for performance
|
// Corpus that will be evolved, we keep it in memory for performance
|
||||||
OnDiskCorpus::new(corpus_dir).unwrap(),
|
InMemoryOnDiskCorpus::new(corpus_dir).unwrap(),
|
||||||
// Corpus in which we store solutions (crashes in this example),
|
// Corpus in which we store solutions (crashes in this example),
|
||||||
// on disk so the user can get them after stopping the fuzzer
|
// on disk so the user can get them after stopping the fuzzer
|
||||||
OnDiskCorpus::new(objective_dir).unwrap(),
|
OnDiskCorpus::new(objective_dir).unwrap(),
|
||||||
|
@ -1053,7 +1053,7 @@ where
|
|||||||
"PROGRAM ABORT : BUG: EOP does not fit in page! page {page:?}, size_current {:?}, size_total {:?}",
|
"PROGRAM ABORT : BUG: EOP does not fit in page! page {page:?}, size_current {:?}, size_total {:?}",
|
||||||
ptr::addr_of!((*page).size_used), ptr::addr_of!((*page).size_total));
|
ptr::addr_of!((*page).size_used), ptr::addr_of!((*page).size_total));
|
||||||
|
|
||||||
let mut ret: *mut LlmpMsg = if last_msg.is_null() {
|
let ret: *mut LlmpMsg = if last_msg.is_null() {
|
||||||
(*page).messages.as_mut_ptr()
|
(*page).messages.as_mut_ptr()
|
||||||
} else {
|
} else {
|
||||||
llmp_next_msg_ptr_checked(map, last_msg, EOP_MSG_SIZE)?
|
llmp_next_msg_ptr_checked(map, last_msg, EOP_MSG_SIZE)?
|
||||||
@ -1266,7 +1266,7 @@ where
|
|||||||
let mut new_map_shmem =
|
let mut new_map_shmem =
|
||||||
self.new_or_unused_shmem((*old_map).sender_id, next_min_shmem_size)?;
|
self.new_or_unused_shmem((*old_map).sender_id, next_min_shmem_size)?;
|
||||||
|
|
||||||
let mut new_map = new_map_shmem.page_mut();
|
let new_map = new_map_shmem.page_mut();
|
||||||
|
|
||||||
#[cfg(feature = "llmp_debug")]
|
#[cfg(feature = "llmp_debug")]
|
||||||
log::info!("got new map at: {new_map:?}");
|
log::info!("got new map at: {new_map:?}");
|
||||||
@ -1286,7 +1286,7 @@ where
|
|||||||
let out = self.alloc_eop()?;
|
let out = self.alloc_eop()?;
|
||||||
|
|
||||||
#[allow(clippy::cast_ptr_alignment)]
|
#[allow(clippy::cast_ptr_alignment)]
|
||||||
let mut end_of_page_msg = (*out).buf.as_mut_ptr() as *mut LlmpPayloadSharedMapInfo;
|
let end_of_page_msg = (*out).buf.as_mut_ptr() as *mut LlmpPayloadSharedMapInfo;
|
||||||
(*end_of_page_msg).map_size = new_map_shmem.shmem.len();
|
(*end_of_page_msg).map_size = new_map_shmem.shmem.len();
|
||||||
(*end_of_page_msg).shm_str = *new_map_shmem.shmem.id().as_array();
|
(*end_of_page_msg).shm_str = *new_map_shmem.shmem.id().as_array();
|
||||||
|
|
||||||
@ -2091,7 +2091,7 @@ where
|
|||||||
|
|
||||||
/// For internal use: Forward the current message to the out map.
|
/// For internal use: Forward the current message to the out map.
|
||||||
unsafe fn forward_msg(&mut self, msg: *mut LlmpMsg) -> Result<(), Error> {
|
unsafe fn forward_msg(&mut self, msg: *mut LlmpMsg) -> Result<(), Error> {
|
||||||
let mut out: *mut LlmpMsg = self.alloc_next((*msg).buf_len_padded as usize)?;
|
let out: *mut LlmpMsg = self.alloc_next((*msg).buf_len_padded as usize)?;
|
||||||
|
|
||||||
/* Copy over the whole message.
|
/* Copy over the whole message.
|
||||||
If we should need zero copy, we could instead post a link to the
|
If we should need zero copy, we could instead post a link to the
|
||||||
|
@ -908,7 +908,7 @@ pub mod windows_asan_handler {
|
|||||||
E::State: HasSolutions + HasClientPerfMonitor + HasCorpus,
|
E::State: HasSolutions + HasClientPerfMonitor + HasCorpus,
|
||||||
Z: HasObjective<Objective = OF, State = E::State>,
|
Z: HasObjective<Objective = OF, State = E::State>,
|
||||||
{
|
{
|
||||||
let mut data = &mut GLOBAL_STATE;
|
let data = &mut GLOBAL_STATE;
|
||||||
// Have we set a timer_before?
|
// Have we set a timer_before?
|
||||||
if !(data.tp_timer as *mut windows::Win32::System::Threading::TP_TIMER).is_null() {
|
if !(data.tp_timer as *mut windows::Win32::System::Threading::TP_TIMER).is_null() {
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user