aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2021-03-27 12:53:09 +0100
committervanhauser-thc <vh@thc.org>2021-03-27 12:53:09 +0100
commit7ca51fab19adfcda211282d4a1134eada7b60d2b (patch)
treec518e1bd8efc536689bf6c2771cad25a8c9b4504 /src
parent5ee2dd6bbdcabbdcc33278876632a9bc5060d71f (diff)
downloadafl++-7ca51fab19adfcda211282d4a1134eada7b60d2b.tar.gz
ensure one fuzzer sync per cycle, cycle introspection
Diffstat (limited to 'src')
-rw-r--r--src/afl-fuzz-run.c1
-rw-r--r--src/afl-fuzz.c22
2 files changed, 16 insertions, 7 deletions
diff --git a/src/afl-fuzz-run.c b/src/afl-fuzz-run.c
index 83133dad..832f17bb 100644
--- a/src/afl-fuzz-run.c
+++ b/src/afl-fuzz-run.c
@@ -712,6 +712,7 @@ void sync_fuzzers(afl_state_t *afl) {
if (afl->foreign_sync_cnt) read_foreign_testcases(afl, 0);
afl->last_sync_time = get_cur_time();
+ afl->last_sync_cycle = afl->queue_cycle;
}
diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c
index a7edb924..9688c84f 100644
--- a/src/afl-fuzz.c
+++ b/src/afl-fuzz.c
@@ -1867,6 +1867,14 @@ int main(int argc, char **argv_orig, char **envp) {
runs_in_current_cycle > afl->queued_paths) ||
(afl->old_seed_selection && !afl->queue_cur))) {
+ if (unlikely((afl->last_sync_cycle < afl->queue_cycle ||
+ (!afl->queue_cycle && afl->afl_env.afl_import_first)) &&
+ afl->sync_id)) {
+
+ sync_fuzzers(afl);
+
+ }
+
++afl->queue_cycle;
runs_in_current_cycle = (u32)-1;
afl->cur_skipped_paths = 0;
@@ -1980,6 +1988,13 @@ int main(int argc, char **argv_orig, char **envp) {
}
+ #ifdef INTROSPECTION
+ fprintf(afl->introspection_file,
+ "CYCLE cycle=%llu cycle_wo_finds=%llu expand_havoc=%u queue=%u\n",
+ afl->queue_cycle, afl->cycles_wo_finds, afl->expand_havoc,
+ afl->queued_paths);
+ #endif
+
if (afl->cycle_schedules) {
/* we cannot mix non-AFLfast schedules with others */
@@ -2031,13 +2046,6 @@ int main(int argc, char **argv_orig, char **envp) {
prev_queued = afl->queued_paths;
- if (afl->sync_id && afl->queue_cycle == 1 &&
- afl->afl_env.afl_import_first) {
-
- sync_fuzzers(afl);
-
- }
-
}
++runs_in_current_cycle;