blob: 4504cffd7f33c23f159ac85dce385c657772e0a1 [file] [log] [blame]
Aaron Ballmanef116982015-01-29 16:58:29 +00001//===- 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 Serebryany52a788e2015-03-31 20:13:20 +00009// 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 Ballmanef116982015-01-29 16:58:29 +000012//===----------------------------------------------------------------------===//
Kostya Serebryany52a788e2015-03-31 20:13:20 +000013FUZZER_FLAG_INT(verbosity, 1, "Verbosity level.")
Mike Aizatskya1a5c692015-12-10 20:41:53 +000014FUZZER_FLAG_UNSIGNED(seed, 0, "Random seed. If 0, seed is generated.")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000015FUZZER_FLAG_INT(runs, -1,
Kostya Serebryany33f86692015-02-04 22:20:09 +000016 "Number of individual test runs (-1 for infinite runs).")
Kostya Serebryany64d24572016-03-12 01:57:04 +000017FUZZER_FLAG_INT(max_len, 0, "Maximum length of the test input. "
18 "If 0, libFuzzer tries to guess a good value based on the corpus "
19 "and reports it. ")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000020FUZZER_FLAG_INT(cross_over, 1, "If 1, cross over inputs.")
21FUZZER_FLAG_INT(mutate_depth, 5,
Aaron Ballmanef116982015-01-29 16:58:29 +000022 "Apply this number of consecutive mutations to each input.")
Kostya Serebryanyfed509e2015-10-17 04:38:26 +000023FUZZER_FLAG_INT(shuffle, 1, "Shuffle inputs at startup")
Kostya Serebryany945761b2016-03-18 00:23:29 +000024FUZZER_FLAG_INT(prefer_small, 1,
25 "If 1, always prefer smaller inputs during the corpus shuffle.")
Kostya Serebryany490bbd62015-05-19 22:12:57 +000026FUZZER_FLAG_INT(
Kostya Serebryany316b5712015-05-26 20:57:47 +000027 timeout, 1200,
Kostya Serebryany490bbd62015-05-19 22:12:57 +000028 "Timeout in seconds (if positive). "
29 "If one unit runs more than this number of seconds the process will abort.")
Kostya Serebryany54a63632016-01-29 23:30:07 +000030FUZZER_FLAG_INT(timeout_exitcode, 77,
31 "Unless abort_on_timeout is set, use this exitcode on timeout.")
Kostya Serebryany228d5b12016-03-01 22:19:21 +000032FUZZER_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 Serebryanyb85db172015-10-02 20:47:55 +000034FUZZER_FLAG_INT(max_total_time, 0, "If positive, indicates the maximal total "
35 "time in seconds to run the fuzzer.")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000036FUZZER_FLAG_INT(help, 0, "Print help.")
Kostya Serebryany9cc3b0d2015-10-24 01:16:40 +000037FUZZER_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 Serebryany1ce4ebf2015-05-13 18:31:46 +000039FUZZER_FLAG_INT(use_counters, 1, "Use coverage counters")
Kostya Serebryany2e9fca92015-10-22 23:55:39 +000040FUZZER_FLAG_INT(use_indir_calls, 1, "Use indirect caller-callee counters")
Kostya Serebryany5a99ecb2015-05-11 20:51:19 +000041FUZZER_FLAG_INT(use_traces, 0, "Experimental: use instruction traces")
Kostya Serebryanyae5b9562016-01-15 06:24:05 +000042FUZZER_FLAG_INT(use_memcmp, 1,
43 "Use hints from intercepting memcmp, strcmp, etc")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000044FUZZER_FLAG_INT(jobs, 0, "Number of jobs to run. If jobs >= 1 we spawn"
Kostya Serebryanye8cee112015-01-31 01:14:40 +000045 " this number of jobs in separate worker processes"
46 " with stdout/stderr redirected to fuzz-JOB.log.")
Kostya Serebryany52a788e2015-03-31 20:13:20 +000047FUZZER_FLAG_INT(workers, 0,
Kostya Serebryany9690fcf2015-05-12 18:51:57 +000048 "Number of simultaneous worker processes to run the jobs."
49 " If zero, \"min(jobs,NumberOfCpuCores()/2)\" is used.")
Kostya Serebryany1ac80552015-05-08 21:30:55 +000050FUZZER_FLAG_INT(reload, 1,
51 "Reload the main corpus periodically to get new units"
Lenny Maiorani1230a542015-08-12 20:00:10 +000052 " discovered by other processes.")
Kostya Serebryany70926ae2015-08-05 21:43:48 +000053FUZZER_FLAG_INT(report_slow_units, 10,
54 "Report slowest units if they run for more than this number of seconds.")
Kostya Serebryanybc7c0ad2015-08-11 01:44:42 +000055FUZZER_FLAG_INT(only_ascii, 0,
56 "If 1, generate only ASCII (isprint+isspace) inputs.")
Kostya Serebryany9838b2b2015-09-03 20:23:46 +000057FUZZER_FLAG_STRING(dict, "Experimental. Use the dictionary file.")
Kostya Serebryanybd5d1cd2015-10-09 03:57:59 +000058FUZZER_FLAG_STRING(artifact_prefix, "Write fuzzing artifacts (crash, "
59 "timeout, or slow inputs) as "
60 "$(artifact_prefix)file")
Kostya Serebryany2d0ef142015-11-25 21:40:46 +000061FUZZER_FLAG_STRING(exact_artifact_path,
62 "Write the single artifact on failure (crash, timeout) "
63 "as $(exact_artifact_path). This overrides -artifact_prefix "
64 "and will not use checksum in the file name. Do not "
65 "use the same path for several parallel processes.")
Kostya Serebryanydc3135d2015-11-12 01:02:01 +000066FUZZER_FLAG_INT(drill, 0, "Experimental: fuzz using a single unit as the seed "
67 "corpus, then merge with the initial corpus")
Mike Aizatskya9c23872015-11-12 04:38:40 +000068FUZZER_FLAG_INT(output_csv, 0, "Enable pulse output in CSV format.")
Mike Aizatsky8b11f872016-01-06 00:21:22 +000069FUZZER_FLAG_INT(print_new_cov_pcs, 0, "If 1, print out new covered pcs.")
Kostya Serebryany66ff0752016-02-26 22:42:23 +000070FUZZER_FLAG_INT(print_final_stats, 0, "If 1, print statistics at exit.")
Mike Aizatsky8b11f872016-01-06 00:21:22 +000071
Kostya Serebryany228d5b12016-03-01 22:19:21 +000072FUZZER_FLAG_INT(handle_segv, 1, "If 1, try to intercept SIGSEGV.")
73FUZZER_FLAG_INT(handle_bus, 1, "If 1, try to intercept SIGSEGV.")
74FUZZER_FLAG_INT(handle_abrt, 1, "If 1, try to intercept SIGABRT.")
75FUZZER_FLAG_INT(handle_ill, 1, "If 1, try to intercept SIGILL.")
76FUZZER_FLAG_INT(handle_fpe, 1, "If 1, try to intercept SIGFPE.")
77FUZZER_FLAG_INT(handle_int, 1, "If 1, try to intercept SIGINT.")
Kostya Serebryanyf389ae12016-03-24 21:03:58 +000078FUZZER_FLAG_INT(handle_term, 1, "If 1, try to intercept SIGTERM.")
Kostya Serebryany49e40902016-03-18 20:58:29 +000079FUZZER_FLAG_INT(close_fd_mask, 0, "If 1, close stdout at startup; "
80 "if 2, close stderr; if 3, close both.")
Kostya Serebryanyc5575aa2016-03-17 19:59:39 +000081
Kostya Serebryany3d95dd92016-03-01 22:33:14 +000082FUZZER_DEPRECATED_FLAG(exit_on_first)
83FUZZER_DEPRECATED_FLAG(save_minimized_corpus)
Kostya Serebryanyc5575aa2016-03-17 19:59:39 +000084FUZZER_DEPRECATED_FLAG(sync_command)
85FUZZER_DEPRECATED_FLAG(sync_timeout)
86FUZZER_DEPRECATED_FLAG(test_single_input)