fix stderr output
@@ -327,10 +327,13 @@ static void __afl_map_shm(void) {
id_str = getenv(CMPLOG_SHM_ENV_VAR);
- if (getenv("AFL_DEBUG"))
+ if (getenv("AFL_DEBUG")) {
+
fprintf(stderr, "DEBUG: cmplog id_str %s\n",
id_str == NULL ? "<null>" : id_str);
+ }
+
if (id_str) {
#ifdef USEMMAP
@@ -402,9 +405,12 @@ static void __afl_start_snapshots(void) {
if (read(FORKSRV_FD, &was_killed, 4) != 4) _exit(1);
- if (getenv("AFL_DEBUG"))
+ if (getenv("AFL_DEBUG")) {
+
fprintf(stderr, "target forkserver recv: %08x\n", was_killed);
+ }
+
if ((was_killed & (FS_OPT_ENABLED | FS_OPT_SHDMEM_FUZZ)) ==
(FS_OPT_ENABLED | FS_OPT_SHDMEM_FUZZ)) {
@@ -611,9 +617,12 @@ static void __afl_start_forkserver(void) {
if (read(FORKSRV_FD, &was_killed, 4) != 4) _exit(1);
- if (getenv("AFL_DEBUG"))
+ if (getenv("AFL_DEBUG")) {
+
fprintf(stderr, "target forkserver recv: %08x\n", was_killed);
+ }
+
if ((was_killed & (FS_OPT_ENABLED | FS_OPT_SHDMEM_FUZZ)) ==
(FS_OPT_ENABLED | FS_OPT_SHDMEM_FUZZ)) {
@@ -908,8 +917,12 @@ void __sanitizer_cov_trace_pc_guard_init(uint32_t *start, uint32_t *stop) {
u32 inst_ratio = 100;
char *x;
- fprintf(stderr, "Running __sanitizer_cov_trace_pc_guard_init: %p-%p\n", start,
- stop);
+ if (getenv("AFL_DEBUG")) {
+
+ fprintf(stderr, "Running __sanitizer_cov_trace_pc_guard_init: %p-%p\n",
+ start, stop);
+
+ }
if (start == stop || *start) return;
