From c240cdec3808bda828e558f5e6019af7105b1b70 Mon Sep 17 00:00:00 2001 From: "Dongjia \"toka\" Zhang" Date: Sun, 14 Jan 2024 01:25:22 +0100 Subject: [PATCH] Increase default edgemap size for libafl_cc and libafl_targets (#1798) --- libafl_cc/build.rs | 2 +- libafl_cc/src/cfg.rs | 2 +- libafl_targets/build.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libafl_cc/build.rs b/libafl_cc/build.rs index 84a9f7e397..0816b2cbb3 100644 --- a/libafl_cc/build.rs +++ b/libafl_cc/build.rs @@ -311,7 +311,7 @@ pub const LIBAFL_CC_LLVM_VERSION: Option = None; let mut cxxflags: Vec = cxxflags.split_whitespace().map(String::from).collect(); let edges_map_size: usize = option_env!("LIBAFL_EDGES_MAP_SIZE") - .map_or(Ok(65536), str::parse) + .map_or(Ok(2621440), str::parse) .expect("Could not parse LIBAFL_EDGES_MAP_SIZE"); cxxflags.push(format!("-DLIBAFL_EDGES_MAP_SIZE={edges_map_size}")); diff --git a/libafl_cc/src/cfg.rs b/libafl_cc/src/cfg.rs index 2c5aed01f1..a7519d37fe 100644 --- a/libafl_cc/src/cfg.rs +++ b/libafl_cc/src/cfg.rs @@ -96,7 +96,7 @@ where #[must_use] pub fn new() -> Self { let map_size = option_env!("LIBAFL_EDGES_MAP_SIZE") - .map_or(Ok(65536), str::parse) + .map_or(Ok(2621440), str::parse) .expect("Could not parse LIBAFL_EDGES_MAP_SIZE"); Self { edges: (0..map_size).map(|_| None).collect(), diff --git a/libafl_targets/build.rs b/libafl_targets/build.rs index 09f2f2059b..81ee333262 100644 --- a/libafl_targets/build.rs +++ b/libafl_targets/build.rs @@ -13,7 +13,7 @@ fn main() { let mut constants_file = File::create(dest_path).expect("Could not create file"); let edges_map_size: usize = option_env!("LIBAFL_EDGES_MAP_SIZE") - .map_or(Ok(65536), str::parse) + .map_or(Ok(2621440), str::parse) .expect("Could not parse LIBAFL_EDGES_MAP_SIZE"); let cmp_map_size: usize = option_env!("LIBAFL_CMP_MAP_SIZE") .map_or(Ok(65536), str::parse)