Skip to content

Commit

Permalink
Adds handling for afl-showmap failures, to avoid crashing the entire …
Browse files Browse the repository at this point in the history
…symcc fuzzing helper (eurecom-s3#1)
  • Loading branch information
WilliamParks authored Mar 26, 2022
1 parent 3133c0b commit 08c29c5
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions util/symcc_fuzzing_helper/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,24 +227,35 @@ impl State {

let mut num_interesting = 0u64;
let mut num_total = 0u64;
let mut num_failed = 0u64;

let symcc_result = symcc
.run(&input, tmp_dir.path().join("output"))
.context("Failed to run SymCC")?;
for new_test in symcc_result.test_cases.iter() {
let res = process_new_testcase(&new_test, &input, &tmp_dir, &afl_config, self)?;
let res = process_new_testcase(&new_test, &input, &tmp_dir, &afl_config, self);

num_total += 1;
if res == TestcaseResult::New {
log::debug!("Test case is interesting");
num_interesting += 1;
}

match res {
Err(e) => {
log::error!("Showmap failed with {}", e);
num_failed += 1;
}
Ok(o) => {
if o == TestcaseResult::New {
log::debug!("Test case is interesting");
num_interesting += 1;
}
}
};
}

log::info!(
"Generated {} test cases ({} new)",
"Generated {} test cases ({} new, {} failed)",
num_total,
num_interesting
num_interesting,
num_failed
);

if symcc_result.killed {
Expand Down

0 comments on commit 08c29c5

Please sign in to comment.