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

Casr-libfuzzer and casr-afl refactoring #128

Merged
merged 19 commits into from
Sep 30, 2023
10 changes: 6 additions & 4 deletions casr/src/triage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! and print overall summary.
use crate::util::{get_path, initialize_dirs, log_progress};

use std::collections::{HashMap, HashSet};
use std::collections::HashMap;
use std::fs;
use std::os::fd::AsFd;
use std::path::{Path, PathBuf};
Expand Down Expand Up @@ -394,13 +394,15 @@ fn summarize_results(

// Check bad reports.
if let Ok(err_dir) = fs::read_dir(dir.join("clerr")) {
let mut unique = HashSet::new();
warn!(
SweetVishnya marked this conversation as resolved.
Show resolved Hide resolved
"{} corrupted reports are saved to {:?}",
err_dir
.filter_map(|x| x.ok())
.map(|x| x.path().with_extension("").with_extension(""))
.filter(|x| unique.insert(x.clone()))
.map(|x| x.path().display().to_string())
.filter(|x| x.ends_with("casrep"))
SweetVishnya marked this conversation as resolved.
Show resolved Hide resolved
SweetVishnya marked this conversation as resolved.
Show resolved Hide resolved
.filter(|x| !x.ends_with("gdb.casrep")
|| !PathBuf::from(x.strip_suffix("gdb.casrep").unwrap().to_string() + "casrep")
.exists())
.count(),
&dir.join("clerr")
);
Expand Down