diff --git a/libafl_bolts/src/fs.rs b/libafl_bolts/src/fs.rs index b4c5b89819..c8333b545c 100644 --- a/libafl_bolts/src/fs.rs +++ b/libafl_bolts/src/fs.rs @@ -1,24 +1,22 @@ //! `LibAFL` functionality for filesystem interaction -use core::sync::atomic::AtomicU64; -use core::sync::atomic::Ordering; +use alloc::{borrow::ToOwned, string::String, sync::Arc, vec::Vec}; +use core::{ + sync::atomic::{AtomicU64, Ordering}, + time::Duration, +}; #[cfg(unix)] use std::os::unix::prelude::{AsRawFd, RawFd}; -use std::sync::OnceLock; - -use alloc::string::String; -use alloc::sync::Arc; -use alloc::{borrow::ToOwned, vec::Vec}; -use core::time::Duration; - -use crate::Error; -use std::time::SystemTime; use std::{ fs::{self, File, OpenOptions, remove_file}, io::{Seek, Write}, path::{Path, PathBuf}, + sync::OnceLock, + time::SystemTime, }; +use crate::Error; + /// The default filename to use to deliver testcases to the target pub const INPUTFILE_STD: &str = ".cur_input"; diff --git a/libafl_targets/src/cmps/mod.rs b/libafl_targets/src/cmps/mod.rs index 64a52d116a..3923e94ede 100644 --- a/libafl_targets/src/cmps/mod.rs +++ b/libafl_targets/src/cmps/mod.rs @@ -64,10 +64,10 @@ unsafe extern "C" { pub static mut libafl_cmplog_map_extended_ptr: *mut CmpLogMap; } -#[cfg(feature = "cmplog")] -pub use libafl_cmplog_map_ptr as CMPLOG_MAP_PTR; #[cfg(feature = "cmplog_extended_instrumentation")] pub use libafl_cmplog_map_extended_ptr as EXTENDED_CMPLOG_MAP_PTR; +#[cfg(feature = "cmplog")] +pub use libafl_cmplog_map_ptr as CMPLOG_MAP_PTR; /// Value indicating if cmplog is enabled. #[unsafe(no_mangle)] diff --git a/libafl_targets/src/forkserver.rs b/libafl_targets/src/forkserver.rs index 738f374c8c..f96d8cc6ac 100644 --- a/libafl_targets/src/forkserver.rs +++ b/libafl_targets/src/forkserver.rs @@ -31,7 +31,6 @@ use nix::{ use crate::cmps::EXTENDED_CMPLOG_MAP_PTR; #[cfg(feature = "cmplog")] use crate::cmps::{AflppCmpLogMap, CMPLOG_MAP_PTR}; - use crate::coverage::{__afl_map_size, EDGES_MAP_PTR, INPUT_LENGTH_PTR, INPUT_PTR, SHM_FUZZING}; #[cfg(any(target_os = "linux", target_vendor = "apple"))] use crate::coverage::{__token_start, __token_stop}; diff --git a/utils/libafl_benches/Cargo.toml b/utils/libafl_benches/Cargo.toml index 82d5c5d3ef..e8badfc087 100644 --- a/utils/libafl_benches/Cargo.toml +++ b/utils/libafl_benches/Cargo.toml @@ -23,7 +23,7 @@ categories = [ [dev-dependencies] libafl_bolts = { workspace = true, features = ["xxh3", "alloc"] } # libafl_bolts -criterion = "0.5.1" # Benchmarking +criterion = "0.6.0" # Benchmarking ahash = { workspace = true, default-features = false } # The hash function already used in hashbrown rustc-hash = { version = "2.0.0", default-features = false } # yet another hash xxhash-rust = { version = "0.8.12", features = [ diff --git a/utils/libafl_benches/benches/hash_speeds.rs b/utils/libafl_benches/benches/hash_speeds.rs index 2118788c6c..7682cc891e 100644 --- a/utils/libafl_benches/benches/hash_speeds.rs +++ b/utils/libafl_benches/benches/hash_speeds.rs @@ -2,10 +2,11 @@ use core::{ hash::{BuildHasher, Hasher}, + hint::black_box, num::NonZero, }; -use criterion::{Criterion, black_box, criterion_group, criterion_main}; +use criterion::{Criterion, criterion_group, criterion_main}; use libafl_bolts::rands::{Rand, StdRand}; //use xxhash_rust::const_xxh3; use xxhash_rust::xxh3; diff --git a/utils/libafl_benches/benches/rand_speeds.rs b/utils/libafl_benches/benches/rand_speeds.rs index 5a85894854..fb79ad53c1 100644 --- a/utils/libafl_benches/benches/rand_speeds.rs +++ b/utils/libafl_benches/benches/rand_speeds.rs @@ -1,6 +1,8 @@ //! Compare the speed of rand implementations -use criterion::{Criterion, black_box, criterion_group, criterion_main}; +use core::hint::black_box; + +use criterion::{Criterion, criterion_group, criterion_main}; use libafl_bolts::rands::{ Lehmer64Rand, Rand, RomuDuoJrRand, RomuTrioRand, Sfc64Rand, XorShift64Rand, Xoshiro256PlusPlusRand,