mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-16 11:58:08 +00:00
fix sync mode
This commit is contained in:
@ -249,7 +249,7 @@ static int stricmp(char const *a, char const *b) {
|
||||
|
||||
int main(int argc, char **argv_orig, char **envp) {
|
||||
|
||||
s32 opt, i;
|
||||
s32 opt, i, auto_sync = 0;
|
||||
u64 prev_queued = 0;
|
||||
u32 sync_interval_cnt = 0, seek_to = 0, show_help = 0, map_size = MAP_SIZE;
|
||||
u8 *extras_dir[4];
|
||||
@ -847,7 +847,7 @@ int main(int argc, char **argv_orig, char **envp) {
|
||||
"Eißfeldt, Andrea Fioraldi and Dominik Maier");
|
||||
OKF("afl++ is open source, get it at "
|
||||
"https://github.com/AFLplusplus/AFLplusplus");
|
||||
OKF("NOTE: This is v3.x which changes several defaults and behaviours - see "
|
||||
OKF("NOTE: This is v3.x which changes defaults and behaviours - see "
|
||||
"README.md");
|
||||
|
||||
if (afl->sync_id && afl->is_main_node &&
|
||||
@ -880,6 +880,15 @@ int main(int argc, char **argv_orig, char **envp) {
|
||||
|
||||
afl->power_name = power_names[afl->schedule];
|
||||
|
||||
if (!afl->sync_id) {
|
||||
|
||||
auto_sync = 1;
|
||||
afl->sync_id = ck_strdup("default");
|
||||
afl->is_secondary_node = 1;
|
||||
OKF("no -M/-S set, autoconfiguring for \"-S %s\"", afl->sync_id);
|
||||
|
||||
}
|
||||
|
||||
if (afl->sync_id) { fix_up_sync(afl); }
|
||||
|
||||
if (!strcmp(afl->in_dir, afl->out_dir)) {
|
||||
@ -1137,19 +1146,15 @@ int main(int argc, char **argv_orig, char **envp) {
|
||||
WARNF("it is wasteful to run more than one main node!");
|
||||
sleep(1);
|
||||
|
||||
} else if (afl->is_secondary_node && check_main_node_exists(afl) == 0) {
|
||||
} else if (!auto_sync && afl->is_secondary_node &&
|
||||
|
||||
check_main_node_exists(afl) == 0) {
|
||||
|
||||
WARNF(
|
||||
"no -M main node found. It is recommended to run exactly one main "
|
||||
"instance.");
|
||||
sleep(1);
|
||||
|
||||
} else if (!afl->sync_id) {
|
||||
|
||||
afl->sync_id = "default";
|
||||
afl->is_secondary_node = 1;
|
||||
OKF("no -M/-S set, autoconfiguring for \"-S %s\"", afl->sync_id);
|
||||
|
||||
}
|
||||
|
||||
#ifdef RAND_TEST_VALUES
|
||||
@ -1419,7 +1424,7 @@ int main(int argc, char **argv_orig, char **envp) {
|
||||
break;
|
||||
case 4:
|
||||
// if not in sync mode, enable deterministic mode?
|
||||
// if (!afl->sync_dir) afl->skip_deterministic = 0;
|
||||
// if (!afl->sync_id) afl->skip_deterministic = 0;
|
||||
afl->expand_havoc = 5;
|
||||
break;
|
||||
case 5:
|
||||
|
Reference in New Issue
Block a user