MCPcopy Create free account
hub / github.com/FuzzAnything/PromptFuzz / execute_cov_fuzzer

Method execute_cov_fuzzer

src/execution/mod.rs:408–433  ·  view source on GitHub ↗
(
        &self,
        fuzzer_binary: &Path,
        corpus_file: &Path,
        profraw: &Path,
    )

Source from the content-addressed store, hash-verified

406 }
407
408 pub fn execute_cov_fuzzer(
409 &self,
410 fuzzer_binary: &Path,
411 corpus_file: &Path,
412 profraw: &Path,
413 ) -> Result<()> {
414 let extra_envs = vec![(OsStr::new("LLVM_PROFILE_FILE"), profraw.as_os_str())];
415 let extra_args = vec![corpus_file.as_os_str(), OsStr::new("-runs=0")];
416 let mut child = self.spawn(fuzzer_binary, extra_args, extra_envs, None, None, false);
417 let timeout = std::time::Duration::from_secs(crate::config::COVERFAGE_TIMEOUT);
418 let status = match child.wait_timeout(timeout).unwrap() {
419 Some(status) => status.code(),
420 None => {
421 child.kill().unwrap();
422 child.wait().unwrap().code()
423 }
424 };
425 if !is_exit_normally(status) {
426 log::warn!("execute fuzz_cov failed! {fuzzer_binary:?}, {corpus_file:?}");
427 if let Some(err) = child.stderr.take() {
428 let err_msg = get_child_err(err);
429 log::error!("Error: {err_msg}");
430 }
431 }
432 Ok(())
433 }
434
435 pub fn execute_cov_fuzzer_pool(
436 &self,

Callers 1

Calls 3

is_exit_normallyFunction · 0.85
get_child_errFunction · 0.85
spawnMethod · 0.80

Tested by

no test coverage detected