Skip to content

Commit

Permalink
Revert "save trace of the found bug (#533)" (#534)
Browse files Browse the repository at this point in the history
This reverts commit 6b1c2d8.
  • Loading branch information
Raz0r authored Aug 29, 2024
1 parent 6b1c2d8 commit 3d32fb2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
10 changes: 9 additions & 1 deletion src/evm/cov_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,15 @@ where
.deref()
.borrow_mut()
.save_trace(format!("{}/{}", self.trace_dir, i).as_str());

if let Some(bug_idx) = meta.corpus_idx_to_bug.get(&i.into()) {
for id in bug_idx {
fs::copy(
format!("{}/{}.json", self.trace_dir, i),
format!("{}/bug_{}.json", self.trace_dir, id),
)
.unwrap();
}
}
unsafe {
EVAL_COVERAGE = false;
}
Expand Down
13 changes: 0 additions & 13 deletions src/fuzzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ where
+ HasExecutionResult<Loc, Addr, VS, Out, CI>
+ HasExecutions
+ HasMetadata
+ HasCurrentInputIdx
+ HasRand
+ HasLastReportTime
+ UsesInput<Input = I>,
Expand Down Expand Up @@ -579,18 +578,6 @@ where

solution::generate_test(cur_report.clone(), minimized);

unsafe {
for bug_idx in ORACLE_OUTPUT.iter().map(|v| v["bug_idx"].as_u64().unwrap()) {
let src = format!("{}/traces/{}.json", self.work_dir, &state.get_current_input_idx());
let dest = format!("{}/traces/bug_{}.json", self.work_dir, bug_idx);
if std::fs::metadata(&src).is_ok() {
std::fs::copy(&src, &dest).unwrap();
} else {
eprintln!("Source trace {} does not exist", src);
}
}
}

let vuln_file = format!("{}/vuln_info.jsonl", self.work_dir.as_str());
let mut f = OpenOptions::new()
.create(true)
Expand Down

0 comments on commit 3d32fb2

Please sign in to comment.