make asan_log optional in CrashReport (#714)

This commit is contained in:
bmc-msft
2021-03-23 02:36:20 -04:00
committed by GitHub
parent 24a20b6c28
commit 92d8299412
3 changed files with 6 additions and 8 deletions

View File

@ -208,7 +208,7 @@ impl CrashReport {
minimized_stack_function_names: crash_log.minimized_stack_function_names,
minimized_stack_function_names_sha256,
call_stack: crash_log.call_stack,
asan_log: Some(crash_log.text),
asan_log: crash_log.text,
scariness_score: crash_log.scariness_score,
scariness_description: crash_log.scariness_description,
task_id,

View File

@ -169,12 +169,11 @@ impl<'a> Tester<'a> {
};
let fault_type = exception.description.to_string();
let text = "".to_string();
let sanitizer = fault_type.to_string();
let summary = crash_site;
Some(CrashLog::new(
text, summary, sanitizer, fault_type, None, None, call_stack,
None, summary, sanitizer, fault_type, None, None, call_stack,
)?)
} else {
None
@ -254,13 +253,12 @@ impl<'a> Tester<'a> {
CRASH_SITE_UNAVAILABLE.to_owned()
};
let text = "".to_string();
let summary = crash_site;
let sanitizer = crash_type.clone();
let fault_type = crash_type;
Some(CrashLog::new(
text, summary, sanitizer, fault_type, None, None, call_stack,
None, summary, sanitizer, fault_type, None, None, call_stack,
)?)
} else {
None

View File

@ -40,7 +40,7 @@ pub struct StackEntry {
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
pub struct CrashLog {
pub text: String,
pub text: Option<String>,
pub sanitizer: String,
pub summary: String,
pub fault_type: String,
@ -121,7 +121,7 @@ fn filter_funcs(entry: &StackEntry, stack_filter: &RegexSet) -> Option<StackEntr
impl CrashLog {
pub fn new(
text: String,
text: Option<String>,
summary: String,
sanitizer: String,
fault_type: String,
@ -184,7 +184,7 @@ impl CrashLog {
let stack = parse_call_stack(&text).unwrap_or_default();
let (scariness_score, scariness_description) = parse_scariness(&text);
Self::new(
text,
Some(text),
summary,
sanitizer,
fault_type,