while (seek_to) { current_entry++; seek_to--; queue_cur = queue_cur->next; }
show_stats();
if (not_on_tty) { ACTF("Entering queue cycle %llu.", queue_cycle); fflush(stdout); }
/* If we had a full queue cycle with no new finds, try recombination strategies next. */ // queued_paths,就是队列中testcase的数量,如果不变的话,就使用splice if (queued_paths == prev_queued) {
if (use_splicing) cycles_wo_finds++; else use_splicing = 1;
} else cycles_wo_finds = 0;
prev_queued = queued_paths;
if (sync_id && queue_cycle == 1 && getenv("AFL_IMPORT_FIRST")) sync_fuzzers(use_argv);
} // 这里去fuzz一次 skipped_fuzz = fuzz_one(use_argv); // sync_fuzzer是从其他fuzz找testcase,应该用在多线程fuzz里 if (!stop_soon && sync_id && !skipped_fuzz) { if (!(sync_interval_cnt++ % SYNC_INTERVAL)) sync_fuzzers(use_argv);
}
if (!stop_soon && exit_1) stop_soon = 2;
if (stop_soon) break; // 更换下一个case进行fuzz queue_cur = queue_cur->next; current_entry++;
}
if (queue_cur) show_stats();
/* If we stopped programmatically, we kill the forkserver and the current runner. If we stopped manually, this is done by the signal handler. */ if (stop_soon == 2) { if (child_pid > 0) kill(child_pid, SIGKILL); if (forksrv_pid > 0) kill(forksrv_pid, SIGKILL); } /* Now that we've killed the forkserver, we wait for it to be able to get rusage stats. */ if (waitpid(forksrv_pid, NULL, 0) <= 0) { WARNF("error waitpid\n"); }