about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2024-10-28 09:52:51 +0100
committervanhauser-thc <vh@thc.org>2024-10-28 09:53:01 +0100
commit577b286508a72114d607e41ec37f6f201e9e5ce6 (patch)
treeab5a0360add357bcd20ce1270f53669fd43f5961
parent009f663e2c9c5c00ab2159598b4c4b3eddde1f06 (diff)
downloadafl++-577b286508a72114d607e41ec37f6f201e9e5ce6.tar.gz
fix explanation how to obtain the map size
-rw-r--r--docs/Changelog.md1
-rw-r--r--instrumentation/afl-compiler-rt.o.c6
-rw-r--r--src/afl-forkserver.c6
3 files changed, 10 insertions, 3 deletions
diff --git a/docs/Changelog.md b/docs/Changelog.md
index 8a445084..1d6d9060 100644
--- a/docs/Changelog.md
+++ b/docs/Changelog.md
@@ -39,6 +39,7 @@
       AFL_LLVM_INSTRUMENT=CLASSIC
     - new compile time variable: `AFL_OPT_LEVEL` to set a specific optimization
       level, default is `3`
+    - correctly explain how to get the correct map size for large targets
   - code formatting updated to llvm 18
   - improved custom_mutators/aflpp/standalone/aflpp-standalone
   - added custom_mutators/autotokens/standalone/autotokens-standalone
diff --git a/instrumentation/afl-compiler-rt.o.c b/instrumentation/afl-compiler-rt.o.c
index 6084880f..075d4d29 100644
--- a/instrumentation/afl-compiler-rt.o.c
+++ b/instrumentation/afl-compiler-rt.o.c
@@ -367,6 +367,12 @@ static void __afl_map_shm(void) {
 
     }
 
+    if (__afl_debug) {
+
+      fprintf(stderr, "DEBUG: AFL_MAP_SIZE=%u\n", __afl_map_size);
+
+    }
+
     if (__afl_final_loc > MAP_SIZE) {
 
       char *ptr;
diff --git a/src/afl-forkserver.c b/src/afl-forkserver.c
index 51299009..9f619c14 100644
--- a/src/afl-forkserver.c
+++ b/src/afl-forkserver.c
@@ -495,9 +495,9 @@ static void report_error_and_exit(int error) {
       FATAL(
           "AFL_MAP_SIZE is not set and fuzzing target reports that the "
           "required size is very large. Solution: Run the fuzzing target "
-          "stand-alone with the environment variable AFL_DEBUG=1 set and set "
-          "the value for __afl_final_loc in the AFL_MAP_SIZE environment "
-          "variable for afl-fuzz.");
+          "stand-alone with the environment variable AFL_DUMP_MAP_SIZE=1 set "
+          "the displayed value in the AFL_MAP_SIZE environment variable for "
+          "afl-fuzz.");
       break;
     case FS_ERROR_MAP_ADDR:
       FATAL(