Aaron Ballman | ef11698 | 2015-01-29 16:58:29 +0000 | [diff] [blame] | 1 | //===- FuzzerFlags.def - Run-time flags -------------------------*- C++ -* ===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
Kostya Serebryany | 52a788e | 2015-03-31 20:13:20 +0000 | [diff] [blame] | 9 | // Flags. FUZZER_FLAG_INT/FUZZER_FLAG_STRING macros should be defined at the |
| 10 | // point of inclusion. We are not using any flag parsing library for better |
| 11 | // portability and independence. |
Aaron Ballman | ef11698 | 2015-01-29 16:58:29 +0000 | [diff] [blame] | 12 | //===----------------------------------------------------------------------===// |
Kostya Serebryany | 52a788e | 2015-03-31 20:13:20 +0000 | [diff] [blame] | 13 | FUZZER_FLAG_INT(verbosity, 1, "Verbosity level.") |
Mike Aizatsky | a1a5c69 | 2015-12-10 20:41:53 +0000 | [diff] [blame] | 14 | FUZZER_FLAG_UNSIGNED(seed, 0, "Random seed. If 0, seed is generated.") |
Kostya Serebryany | 52a788e | 2015-03-31 20:13:20 +0000 | [diff] [blame] | 15 | FUZZER_FLAG_INT(runs, -1, |
Kostya Serebryany | 33f8669 | 2015-02-04 22:20:09 +0000 | [diff] [blame] | 16 | "Number of individual test runs (-1 for infinite runs).") |
Kostya Serebryany | c5f905c | 2015-05-26 19:32:52 +0000 | [diff] [blame] | 17 | FUZZER_FLAG_INT(max_len, 64, "Maximum length of the test input.") |
Kostya Serebryany | 52a788e | 2015-03-31 20:13:20 +0000 | [diff] [blame] | 18 | FUZZER_FLAG_INT(cross_over, 1, "If 1, cross over inputs.") |
| 19 | FUZZER_FLAG_INT(mutate_depth, 5, |
Aaron Ballman | ef11698 | 2015-01-29 16:58:29 +0000 | [diff] [blame] | 20 | "Apply this number of consecutive mutations to each input.") |
Kostya Serebryany | fed509e | 2015-10-17 04:38:26 +0000 | [diff] [blame] | 21 | FUZZER_FLAG_INT(shuffle, 1, "Shuffle inputs at startup") |
Kostya Serebryany | 52a788e | 2015-03-31 20:13:20 +0000 | [diff] [blame] | 22 | FUZZER_FLAG_INT( |
| 23 | prefer_small_during_initial_shuffle, -1, |
Kostya Serebryany | 92e0476 | 2015-02-04 23:42:42 +0000 | [diff] [blame] | 24 | "If 1, always prefer smaller inputs during the initial corpus shuffle." |
| 25 | " If 0, never do that. If -1, do it sometimes.") |
Kostya Serebryany | 490bbd6 | 2015-05-19 22:12:57 +0000 | [diff] [blame] | 26 | FUZZER_FLAG_INT( |
Kostya Serebryany | 316b571 | 2015-05-26 20:57:47 +0000 | [diff] [blame] | 27 | timeout, 1200, |
Kostya Serebryany | 490bbd6 | 2015-05-19 22:12:57 +0000 | [diff] [blame] | 28 | "Timeout in seconds (if positive). " |
| 29 | "If one unit runs more than this number of seconds the process will abort.") |
Kostya Serebryany | 54a6363 | 2016-01-29 23:30:07 +0000 | [diff] [blame] | 30 | FUZZER_FLAG_INT(timeout_exitcode, 77, |
| 31 | "Unless abort_on_timeout is set, use this exitcode on timeout.") |
Kostya Serebryany | 228d5b1 | 2016-03-01 22:19:21 +0000 | [diff] [blame] | 32 | FUZZER_FLAG_INT(error_exit_code, 77, "When libFuzzer's signal handlers are in " |
| 33 | "use exit with this exitcode after catching a deadly signal.") |
Kostya Serebryany | b85db17 | 2015-10-02 20:47:55 +0000 | [diff] [blame] | 34 | FUZZER_FLAG_INT(max_total_time, 0, "If positive, indicates the maximal total " |
| 35 | "time in seconds to run the fuzzer.") |
Kostya Serebryany | 52a788e | 2015-03-31 20:13:20 +0000 | [diff] [blame] | 36 | FUZZER_FLAG_INT(help, 0, "Print help.") |
Kostya Serebryany | 9cc3b0d | 2015-10-24 01:16:40 +0000 | [diff] [blame] | 37 | FUZZER_FLAG_INT(merge, 0, "If 1, the 2-nd, 3-rd, etc corpora will be " |
| 38 | "merged into the 1-st corpus. Only interesting units will be taken.") |
Kostya Serebryany | 1ce4ebf | 2015-05-13 18:31:46 +0000 | [diff] [blame] | 39 | FUZZER_FLAG_INT(use_counters, 1, "Use coverage counters") |
Kostya Serebryany | 2e9fca9 | 2015-10-22 23:55:39 +0000 | [diff] [blame] | 40 | FUZZER_FLAG_INT(use_indir_calls, 1, "Use indirect caller-callee counters") |
Kostya Serebryany | 5a99ecb | 2015-05-11 20:51:19 +0000 | [diff] [blame] | 41 | FUZZER_FLAG_INT(use_traces, 0, "Experimental: use instruction traces") |
Kostya Serebryany | ae5b956 | 2016-01-15 06:24:05 +0000 | [diff] [blame] | 42 | FUZZER_FLAG_INT(use_memcmp, 1, |
| 43 | "Use hints from intercepting memcmp, strcmp, etc") |
Kostya Serebryany | 52a788e | 2015-03-31 20:13:20 +0000 | [diff] [blame] | 44 | FUZZER_FLAG_INT(jobs, 0, "Number of jobs to run. If jobs >= 1 we spawn" |
Kostya Serebryany | e8cee11 | 2015-01-31 01:14:40 +0000 | [diff] [blame] | 45 | " this number of jobs in separate worker processes" |
| 46 | " with stdout/stderr redirected to fuzz-JOB.log.") |
Kostya Serebryany | 52a788e | 2015-03-31 20:13:20 +0000 | [diff] [blame] | 47 | FUZZER_FLAG_INT(workers, 0, |
Kostya Serebryany | 9690fcf | 2015-05-12 18:51:57 +0000 | [diff] [blame] | 48 | "Number of simultaneous worker processes to run the jobs." |
| 49 | " If zero, \"min(jobs,NumberOfCpuCores()/2)\" is used.") |
Kostya Serebryany | 1ac8055 | 2015-05-08 21:30:55 +0000 | [diff] [blame] | 50 | FUZZER_FLAG_INT(reload, 1, |
| 51 | "Reload the main corpus periodically to get new units" |
Lenny Maiorani | 1230a54 | 2015-08-12 20:00:10 +0000 | [diff] [blame] | 52 | " discovered by other processes.") |
Kostya Serebryany | 2da7b84 | 2015-05-18 21:34:20 +0000 | [diff] [blame] | 53 | FUZZER_FLAG_STRING(sync_command, "Execute an external command " |
| 54 | "\"<sync_command> <test_corpus>\" " |
| 55 | "to synchronize the test corpus.") |
Kostya Serebryany | c5f905c | 2015-05-26 19:32:52 +0000 | [diff] [blame] | 56 | FUZZER_FLAG_INT(sync_timeout, 600, "Minimum timeout between syncs.") |
Kostya Serebryany | 70926ae | 2015-08-05 21:43:48 +0000 | [diff] [blame] | 57 | FUZZER_FLAG_INT(report_slow_units, 10, |
| 58 | "Report slowest units if they run for more than this number of seconds.") |
Kostya Serebryany | bc7c0ad | 2015-08-11 01:44:42 +0000 | [diff] [blame] | 59 | FUZZER_FLAG_INT(only_ascii, 0, |
| 60 | "If 1, generate only ASCII (isprint+isspace) inputs.") |
Kostya Serebryany | 9838b2b | 2015-09-03 20:23:46 +0000 | [diff] [blame] | 61 | FUZZER_FLAG_STRING(dict, "Experimental. Use the dictionary file.") |
Kostya Serebryany | b85db17 | 2015-10-02 20:47:55 +0000 | [diff] [blame] | 62 | FUZZER_FLAG_STRING(test_single_input, "Use specified file as test input.") |
Kostya Serebryany | bd5d1cd | 2015-10-09 03:57:59 +0000 | [diff] [blame] | 63 | FUZZER_FLAG_STRING(artifact_prefix, "Write fuzzing artifacts (crash, " |
| 64 | "timeout, or slow inputs) as " |
| 65 | "$(artifact_prefix)file") |
Kostya Serebryany | 2d0ef14 | 2015-11-25 21:40:46 +0000 | [diff] [blame] | 66 | FUZZER_FLAG_STRING(exact_artifact_path, |
| 67 | "Write the single artifact on failure (crash, timeout) " |
| 68 | "as $(exact_artifact_path). This overrides -artifact_prefix " |
| 69 | "and will not use checksum in the file name. Do not " |
| 70 | "use the same path for several parallel processes.") |
Kostya Serebryany | dc3135d | 2015-11-12 01:02:01 +0000 | [diff] [blame] | 71 | FUZZER_FLAG_INT(drill, 0, "Experimental: fuzz using a single unit as the seed " |
| 72 | "corpus, then merge with the initial corpus") |
Mike Aizatsky | a9c2387 | 2015-11-12 04:38:40 +0000 | [diff] [blame] | 73 | FUZZER_FLAG_INT(output_csv, 0, "Enable pulse output in CSV format.") |
Mike Aizatsky | 8b11f87 | 2016-01-06 00:21:22 +0000 | [diff] [blame] | 74 | FUZZER_FLAG_INT(print_new_cov_pcs, 0, "If 1, print out new covered pcs.") |
Kostya Serebryany | 66ff075 | 2016-02-26 22:42:23 +0000 | [diff] [blame] | 75 | FUZZER_FLAG_INT(print_final_stats, 0, "If 1, print statistics at exit.") |
Mike Aizatsky | 8b11f87 | 2016-01-06 00:21:22 +0000 | [diff] [blame] | 76 | |
Kostya Serebryany | 228d5b1 | 2016-03-01 22:19:21 +0000 | [diff] [blame] | 77 | FUZZER_FLAG_INT(handle_segv, 1, "If 1, try to intercept SIGSEGV.") |
| 78 | FUZZER_FLAG_INT(handle_bus, 1, "If 1, try to intercept SIGSEGV.") |
| 79 | FUZZER_FLAG_INT(handle_abrt, 1, "If 1, try to intercept SIGABRT.") |
| 80 | FUZZER_FLAG_INT(handle_ill, 1, "If 1, try to intercept SIGILL.") |
| 81 | FUZZER_FLAG_INT(handle_fpe, 1, "If 1, try to intercept SIGFPE.") |
| 82 | FUZZER_FLAG_INT(handle_int, 1, "If 1, try to intercept SIGINT.") |
Kostya Serebryany | 3d95dd9 | 2016-03-01 22:33:14 +0000 | [diff] [blame^] | 83 | FUZZER_DEPRECATED_FLAG(exit_on_first) |
| 84 | FUZZER_DEPRECATED_FLAG(save_minimized_corpus) |