mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-17 20:38:06 +00:00
check libfuzzer -help=1
prior to starting the heartbeat (#528)
This commit is contained in:
@ -21,6 +21,7 @@ use tokio::task::spawn;
|
||||
pub async fn run(args: &clap::ArgMatches<'_>) -> Result<()> {
|
||||
let fuzz_config = build_fuzz_config(args)?;
|
||||
let fuzzer = LibFuzzerFuzzTask::new(fuzz_config)?;
|
||||
fuzzer.check_libfuzzer().await?;
|
||||
let fuzz_task = spawn(async move { fuzzer.run().await });
|
||||
|
||||
let report_config = build_report_config(args)?;
|
||||
|
@ -162,7 +162,7 @@ impl Config {
|
||||
match self {
|
||||
Config::LibFuzzerFuzz(config) => {
|
||||
fuzz::libfuzzer_fuzz::LibFuzzerFuzzTask::new(config)?
|
||||
.run()
|
||||
.managed_run()
|
||||
.await
|
||||
}
|
||||
Config::LibFuzzerReport(config) => {
|
||||
|
@ -106,19 +106,22 @@ impl CoverageTask {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn managed_run(&mut self) -> Result<()> {
|
||||
info!("starting libFuzzer coverage task");
|
||||
|
||||
async fn check_libfuzzer(&self) -> Result<()> {
|
||||
if self.config.check_fuzzer_help {
|
||||
let target = LibFuzzer::new(
|
||||
let fuzzer = LibFuzzer::new(
|
||||
&self.config.target_exe,
|
||||
&self.config.target_options,
|
||||
&self.config.target_env,
|
||||
&self.config.common.setup_dir,
|
||||
);
|
||||
target.check_help().await?;
|
||||
fuzzer.check_help().await?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn managed_run(&mut self) -> Result<()> {
|
||||
info!("starting libFuzzer coverage task");
|
||||
self.check_libfuzzer().await?;
|
||||
self.config.coverage.init_pull().await?;
|
||||
self.process().await
|
||||
}
|
||||
|
@ -80,6 +80,11 @@ impl LibFuzzerFuzzTask {
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn managed_run(&self) -> Result<()> {
|
||||
self.check_libfuzzer().await?;
|
||||
self.run().await
|
||||
}
|
||||
|
||||
pub async fn run(&self) -> Result<()> {
|
||||
self.init_directories().await?;
|
||||
|
||||
@ -98,6 +103,19 @@ impl LibFuzzerFuzzTask {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn check_libfuzzer(&self) -> Result<()> {
|
||||
if self.config.check_fuzzer_help {
|
||||
let fuzzer = LibFuzzer::new(
|
||||
&self.config.target_exe,
|
||||
&self.config.target_options,
|
||||
&self.config.target_env,
|
||||
&self.config.common.setup_dir,
|
||||
);
|
||||
fuzzer.check_help().await?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn run_fuzzers(&self, stats_sender: Option<&StatsSender>) -> Result<()> {
|
||||
let fuzzers: Vec<_> = (0..self.workers())
|
||||
.map(|id| self.start_fuzzer_monitor(id, stats_sender))
|
||||
|
Reference in New Issue
Block a user