make dominik more happy - no auto map size for qemu+unicorn
MODIFY
instrumentation/afl-compiler-rt.o.c
instrumentation/afl-compiler-rt.o.c
@@ -1169,8 +1169,8 @@ void __sanitizer_cov_trace_pc_guard_init(uint32_t *start, uint32_t *stop) {
if (getenv("AFL_DEBUG")) {
- fprintf(stderr, "Running __sanitizer_cov_trace_pc_guard_init: %p-%p\n",
- start, stop);
+ fprintf(stderr, "Running __sanitizer_cov_trace_pc_guard_init: %p-%p (%lu edges)\n",
+ start, stop, stop - start);
}

MODIFY
src/afl-fuzz.c
src/afl-fuzz.c
@@ -1536,7 +1536,8 @@ int main(int argc, char **argv_orig, char **envp) {
afl->fsrv.trace_bits =
afl_shm_init(&afl->shm, afl->fsrv.map_size, afl->non_instrumented_mode);
- if (!afl->non_instrumented_mode) {
+ if (!afl->non_instrumented_mode && !afl->fsrv.qemu_mode &&
+ !afl->unicorn_mode) {
afl->fsrv.map_size = 4194304; // dummy temporary value

MODIFY
src/afl-showmap.c
src/afl-showmap.c
@@ -1068,12 +1068,15 @@ int main(int argc, char **argv_orig, char **envp) {
fsrv->shmem_fuzz_len = (u32 *)map;
fsrv->shmem_fuzz = map + sizeof(u32);
+ if (!fsrv->qemu_mode && !unicorn_mode) {
+
u32 save_be_quiet = be_quiet;
be_quiet = !debug;
fsrv->map_size = 4194304; // dummy temporary value
- u32 new_map_size = afl_fsrv_get_mapsize(
- fsrv, use_argv, &stop_soon,
- (get_afl_env("AFL_DEBUG_CHILD") || get_afl_env("AFL_DEBUG_CHILD_OUTPUT"))
+ u32 new_map_size =
+ afl_fsrv_get_mapsize(fsrv, use_argv, &stop_soon,
+ (get_afl_env("AFL_DEBUG_CHILD") ||
+ get_afl_env("AFL_DEBUG_CHILD_OUTPUT"))
? 1
: 0);
be_quiet = save_be_quiet;
@@ -1100,6 +1103,8 @@ int main(int argc, char **argv_orig, char **envp) {
fsrv->map_size = map_size;
+ }
+
if (in_dir) {
DIR * dir_in, *dir_out = NULL;

MODIFY
src/afl-tmin.c
src/afl-tmin.c
@@ -1199,10 +1199,13 @@ int main(int argc, char **argv_orig, char **envp) {
read_initial_file();
+ if (!fsrv->qemu_mode && !unicorn_mode) {
+
fsrv->map_size = 4194304; // dummy temporary value
- u32 new_map_size = afl_fsrv_get_mapsize(
- fsrv, use_argv, &stop_soon,
- (get_afl_env("AFL_DEBUG_CHILD") || get_afl_env("AFL_DEBUG_CHILD_OUTPUT"))
+ u32 new_map_size =
+ afl_fsrv_get_mapsize(fsrv, use_argv, &stop_soon,
+ (get_afl_env("AFL_DEBUG_CHILD") ||
+ get_afl_env("AFL_DEBUG_CHILD_OUTPUT"))
? 1
: 0);
@@ -1232,6 +1235,16 @@ int main(int argc, char **argv_orig, char **envp) {
fsrv->map_size = map_size;
+ } else {
+
+ afl_fsrv_start(fsrv, use_argv, &stop_soon,
+ (get_afl_env("AFL_DEBUG_CHILD") ||
+ get_afl_env("AFL_DEBUG_CHILD_OUTPUT"))
+ ? 1
+ : 0);
+
+ }
+
if (fsrv->support_shmem_fuzz && !fsrv->use_shmem_fuzz)
shm_fuzz = deinit_shmem(fsrv, shm_fuzz);

make dominik more happy - no auto map size for qemu+unicorn