Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental support for parallel fuzzing #389

Merged
merged 5 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ Options:
--backtrace Display backtraces
--consolidate Move one target's crashes, hangs, and work queue to its corpus; to
consolidate all targets, use --consolidate-all
--cpus <N> Fuzz using at most <N> cpus; default is all but one
--display <OBJECT> Display corpus, crashes, generic args, `impl` generic args, hangs,
or work queue. By default, corpus uses an uninstrumented fuzz
target; the others use an instrumented fuzz target. To display the
Expand Down Expand Up @@ -282,6 +283,8 @@ Options:
reset all targets, use --reset-all
--resume Resume target's last fuzzing session
--run-until-crash Stop fuzzing once a crash is found
--slice <SECONDS> When there are not sufficiently many cpus to fuzz all targets
concurrently, fuzz them in intervals of <SECONDS> [default: 1200]
--test <NAME> Integration test containing fuzz target
--timeout <TIMEOUT> Number of seconds to consider a hang when fuzzing or replaying
(equivalent to -- -t <TIMEOUT * 1000> when fuzzing)
Expand Down
3 changes: 3 additions & 0 deletions cargo-test-fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ clap = { version = "4.5", features = ["cargo", "derive", "wrap_help"] }
env_logger = "0.11"
heck = "0.5"
log = "0.4"
mio = { version = "0.8", features = ["os-ext", "os-poll"] }
num_cpus = "1.16"
paste = "1.0"
remain = "0.2"
semver = "1.0"
Expand All @@ -45,6 +47,7 @@ rustc_version = "0.4"
semver = "1.0"
serde_json = "1.0"
tempfile = "3.10"
walkdir = "2.5"
xshell = "0.2"

testing = { path = "../testing", package = "test-fuzz-testing" }
Expand Down
18 changes: 18 additions & 0 deletions cargo-test-fuzz/src/bin/cargo_test_fuzz/transition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ struct TestFuzzWithDeprecations {
consolidate: bool,
#[arg(long, hide = true)]
consolidate_all: bool,
#[arg(
long,
value_name = "N",
help = "Fuzz using at most <N> cpus; default is all but one"
)]
cpus: Option<usize>,
#[arg(
long,
value_name = "OBJECT",
Expand Down Expand Up @@ -107,6 +113,14 @@ struct TestFuzzWithDeprecations {
resume: bool,
#[arg(long, help = "Stop fuzzing once a crash is found")]
run_until_crash: bool,
#[arg(
long,
value_name = "SECONDS",
default_value = "1200",
help = "When there are not sufficiently many cpus to fuzz all targets concurrently, fuzz \
them in intervals of <SECONDS>"
)]
slice: u64,
#[arg(
long,
value_name = "NAME",
Expand Down Expand Up @@ -136,6 +150,7 @@ impl From<TestFuzzWithDeprecations> for super::TestFuzz {
backtrace,
consolidate,
consolidate_all,
cpus,
display,
exact,
exit_code,
Expand All @@ -155,6 +170,7 @@ impl From<TestFuzzWithDeprecations> for super::TestFuzz {
reset_all,
resume,
run_until_crash,
slice,
test,
timeout,
verbose,
Expand All @@ -165,6 +181,7 @@ impl From<TestFuzzWithDeprecations> for super::TestFuzz {
backtrace,
consolidate,
consolidate_all,
cpus,
display,
exact,
exit_code,
Expand All @@ -184,6 +201,7 @@ impl From<TestFuzzWithDeprecations> for super::TestFuzz {
reset_all,
resume,
run_until_crash,
slice,
test,
timeout,
verbose,
Expand Down
Loading