about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--docs/Changelog.md2
-rw-r--r--src/afl-fuzz.c20
2 files changed, 18 insertions, 4 deletions
diff --git a/docs/Changelog.md b/docs/Changelog.md
index 81ac91b0..e0f8e9bf 100644
--- a/docs/Changelog.md
+++ b/docs/Changelog.md
@@ -17,6 +17,8 @@ sending a mail to <afl-users+subscribe@googlegroups.com>.
   - afl-fuzz
     - fix crash for very, very fast targets+systems (thanks to mhlakhani
       for reporting)
+    - if determinstic mode is active (-D, or -M without -d) then we sync
+      after every queue entry as this can take very long time otherwise
     - switched to a faster RNG
     - added hghwng's patch for faster trace map analysis
   - afl-cc
diff --git a/src/afl-fuzz.c b/src/afl-fuzz.c
index 6a2b28cf..bb2674f0 100644
--- a/src/afl-fuzz.c
+++ b/src/afl-fuzz.c
@@ -1781,15 +1781,27 @@ int main(int argc, char **argv_orig, char **envp) {
 
     } while (skipped_fuzz && afl->queue_cur && !afl->stop_soon);
 
-    if (!afl->stop_soon && afl->sync_id) {
+    if (likely(!afl->stop_soon && afl->sync_id)) {
 
-      if (unlikely(afl->is_main_node)) {
+      if (likely(afl->skip_deterministic)) {
 
-        if (!(sync_interval_cnt++ % (SYNC_INTERVAL / 3))) { sync_fuzzers(afl); }
+        if (unlikely(afl->is_main_node)) {
+
+          if (!(sync_interval_cnt++ % (SYNC_INTERVAL / 3))) {
+
+            sync_fuzzers(afl);
+
+          }
+
+        } else {
+
+          if (!(sync_interval_cnt++ % SYNC_INTERVAL)) { sync_fuzzers(afl); }
+
+        }
 
       } else {
 
-        if (!(sync_interval_cnt++ % SYNC_INTERVAL)) { sync_fuzzers(afl); }
+        sync_fuzzers(afl);
 
       }