Use InMemoryOnDiskCorpus in fuzzbench fuzzer (#1240)

* in memory

* f

* aaa

* nn
This commit is contained in:
Dongjia "toka" Zhang 2023-05-02 15:18:17 +02:00 committed by GitHub
parent 95d1069393
commit c8fad7833d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -24,7 +24,7 @@ use libafl::{
tuples::{tuple_list, Merge},
AsSlice,
},
corpus::{Corpus, OnDiskCorpus},
corpus::{Corpus, InMemoryOnDiskCorpus, OnDiskCorpus},
events::SimpleRestartingEventManager,
executors::{inprocess::InProcessExecutor, ExitKind, TimeoutExecutor},
feedback_or,
@ -271,7 +271,7 @@ fn fuzz(
// RNG
StdRand::with_seed(current_nanos()),
// 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),
// on disk so the user can get them after stopping the fuzzer
OnDiskCorpus::new(objective_dir).unwrap(),

View File

@ -1053,7 +1053,7 @@ where
"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));
let mut ret: *mut LlmpMsg = if last_msg.is_null() {
let ret: *mut LlmpMsg = if last_msg.is_null() {
(*page).messages.as_mut_ptr()
} else {
llmp_next_msg_ptr_checked(map, last_msg, EOP_MSG_SIZE)?
@ -1266,7 +1266,7 @@ where
let mut new_map_shmem =
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")]
log::info!("got new map at: {new_map:?}");
@ -1286,7 +1286,7 @@ where
let out = self.alloc_eop()?;
#[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).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.
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.
If we should need zero copy, we could instead post a link to the

View File

@ -908,7 +908,7 @@ pub mod windows_asan_handler {
E::State: HasSolutions + HasClientPerfMonitor + HasCorpus,
Z: HasObjective<Objective = OF, State = E::State>,
{
let mut data = &mut GLOBAL_STATE;
let data = &mut GLOBAL_STATE;
// Have we set a timer_before?
if !(data.tp_timer as *mut windows::Win32::System::Threading::TP_TIMER).is_null() {
/*