Remove prelude from default features (#2608)

* Remove prelude from default features

* Prelude

* something
This commit is contained in:
Dominik Maier 2024-10-12 13:16:22 +02:00 committed by GitHub
parent 18fb6a4197
commit cad9e2717e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 21 additions and 17 deletions

View File

@ -8,4 +8,9 @@
"cargo", "cargo",
"check", "check",
], ],
"workbench.colorCustomizations": {
"activityBar.background": "#F39C9F",
"titleBar.activeBackground": "#F7BFC1",
"titleBar.activeForeground": "#370708"
},
} }

View File

@ -3,9 +3,8 @@ use std::{borrow::Cow, collections::VecDeque};
use libafl::{ use libafl::{
corpus::{Corpus, Testcase}, corpus::{Corpus, Testcase},
executors::ExitKind, executors::ExitKind,
feedbacks::{Feedback, FeedbackFactory}, feedbacks::{Feedback, FeedbackFactory, StateInitializer},
inputs::Input, inputs::Input,
prelude::StateInitializer,
state::HasCorpus, state::HasCorpus,
}; };
use libafl_bolts::{Error, Named}; use libafl_bolts::{Error, Named};

View File

@ -1,7 +1,10 @@
use std::{borrow::Cow, marker::PhantomData}; use std::{borrow::Cow, marker::PhantomData};
use libafl::{ use libafl::{
corpus::Testcase, executors::ExitKind, feedbacks::Feedback, prelude::StateInitializer, Error, corpus::Testcase,
executors::ExitKind,
feedbacks::{Feedback, StateInitializer},
Error,
}; };
use libafl_bolts::Named; use libafl_bolts::Named;

View File

@ -6,7 +6,7 @@ use libafl::{
state::{State, UsesState}, state::{State, UsesState},
HasMetadata, HasMetadata,
}; };
use libafl_bolts::current_time; use libafl_bolts::{current_time, Error};
pub struct TimeTrackingStageWrapper<T, S, ST> { pub struct TimeTrackingStageWrapper<T, S, ST> {
inner: ST, inner: ST,
@ -46,7 +46,7 @@ where
executor: &mut E, executor: &mut E,
state: &mut Self::State, state: &mut Self::State,
manager: &mut M, manager: &mut M,
) -> Result<(), libafl::prelude::Error> { ) -> Result<(), Error> {
let before_run = current_time(); let before_run = current_time();
self.inner.perform(fuzzer, executor, state, manager)?; self.inner.perform(fuzzer, executor, state, manager)?;
let after_run = current_time(); let after_run = current_time();
@ -55,11 +55,11 @@ where
Ok(()) Ok(())
} }
fn should_restart(&mut self, state: &mut Self::State) -> Result<bool, libafl::prelude::Error> { fn should_restart(&mut self, state: &mut Self::State) -> Result<bool, Error> {
self.inner.should_restart(state) self.inner.should_restart(state)
} }
fn clear_progress(&mut self, state: &mut Self::State) -> Result<(), libafl::prelude::Error> { fn clear_progress(&mut self, state: &mut Self::State) -> Result<(), Error> {
self.inner.clear_progress(state) self.inner.clear_progress(state)
} }
@ -69,7 +69,7 @@ where
executor: &mut E, executor: &mut E,
state: &mut Self::State, state: &mut Self::State,
manager: &mut M, manager: &mut M,
) -> Result<(), libafl::prelude::Error> { ) -> Result<(), Error> {
self.inner self.inner
.perform_restartable(fuzzer, executor, state, manager) .perform_restartable(fuzzer, executor, state, manager)
} }

View File

@ -39,7 +39,7 @@ fn input_generator() {
ExitKind::Ok ExitKind::Ok
}; };
let signals_ptr = addr_of_mut!(SIGNALS); let signals_ptr = unsafe { addr_of_mut!(SIGNALS) };
let signals_len = unsafe { *signals_ptr }.len(); let signals_len = unsafe { *signals_ptr }.len();
// Create an observation channel using the signals map // Create an observation channel using the signals map

View File

@ -5,10 +5,9 @@ use std::{
use libafl::{ use libafl::{
corpus::CorpusId, corpus::CorpusId,
generators::Generator, generators::{Generator, RandBytesGenerator},
inputs::{BytesInput, HasTargetBytes, Input, MutVecInput}, inputs::{BytesInput, HasTargetBytes, Input, MutVecInput},
mutators::{MutationResult, Mutator}, mutators::{MutationResult, Mutator},
prelude::RandBytesGenerator,
state::HasRand, state::HasRand,
Error, SerdeAny, Error, SerdeAny,
}; };

View File

@ -42,7 +42,7 @@ use {
/// Coverage map with explicit assignments due to the lack of instrumentation /// Coverage map with explicit assignments due to the lack of instrumentation
const SIGNALS_LEN: usize = 16; const SIGNALS_LEN: usize = 16;
static mut SIGNALS: [u8; SIGNALS_LEN] = [0; 16]; static mut SIGNALS: [u8; SIGNALS_LEN] = [0; 16];
static mut SIGNALS_PTR: *mut u8 = addr_of_mut!(SIGNALS) as _; static mut SIGNALS_PTR: *mut u8 = unsafe { addr_of_mut!(SIGNALS) as _ };
/// Assign a signal to the signals map /// Assign a signal to the signals map
fn signals_set(idx: usize) { fn signals_set(idx: usize) {

View File

@ -30,7 +30,7 @@ use libafl_bolts::{rands::StdRand, tuples::tuple_list};
/// Coverage map with explicit assignments due to the lack of instrumentation /// Coverage map with explicit assignments due to the lack of instrumentation
const SIGNALS_LEN: usize = 16; const SIGNALS_LEN: usize = 16;
static mut SIGNALS: [u8; SIGNALS_LEN] = [0; SIGNALS_LEN]; static mut SIGNALS: [u8; SIGNALS_LEN] = [0; SIGNALS_LEN];
static mut SIGNALS_PTR: *mut u8 = addr_of_mut!(SIGNALS) as _; static mut SIGNALS_PTR: *mut u8 = unsafe { addr_of_mut!(SIGNALS) as _ };
/* /*
/// Assign a signal to the signals map /// Assign a signal to the signals map
fn signals_set(idx: usize) { fn signals_set(idx: usize) {

View File

@ -34,7 +34,6 @@ default = [
"llmp_broker_timeouts", "llmp_broker_timeouts",
"rand_trait", "rand_trait",
"fork", "fork",
"prelude",
"gzip", "gzip",
"regex", "regex",
"serdeany_autoreg", "serdeany_autoreg",

View File

@ -9,7 +9,7 @@ use core::{
use std::{ use std::{
env, env,
ffi::{OsStr, OsString}, ffi::{OsStr, OsString},
io::{self, prelude::*, ErrorKind}, io::{self, ErrorKind, Read, Write},
os::{ os::{
fd::{AsRawFd, BorrowedFd}, fd::{AsRawFd, BorrowedFd},
unix::{io::RawFd, process::CommandExt}, unix::{io::RawFd, process::CommandExt},

View File

@ -32,7 +32,6 @@ default = [
"llmp_compression", "llmp_compression",
"llmp_small_maps", "llmp_small_maps",
"rand_trait", "rand_trait",
"prelude",
"gzip", "gzip",
"serdeany_autoreg", "serdeany_autoreg",
"alloc", "alloc",

View File

@ -9,7 +9,7 @@ use std::marker::PhantomData;
#[cfg(all(feature = "std", not(target_os = "haiku")))] #[cfg(all(feature = "std", not(target_os = "haiku")))]
use std::{num::NonZeroUsize, thread, time}; use std::{num::NonZeroUsize, thread, time};
use libafl_bolts::{bolts_prelude::LlmpMsgHookResult, llmp::LlmpBrokerInner}; use libafl_bolts::llmp::{LlmpBrokerInner, LlmpMsgHookResult};
#[cfg(all(feature = "std", not(target_os = "haiku")))] #[cfg(all(feature = "std", not(target_os = "haiku")))]
use libafl_bolts::{ use libafl_bolts::{
llmp::{self, Flags, LlmpHook, Tag}, llmp::{self, Flags, LlmpHook, Tag},