Skip to content

Commit a4c9d2d

Browse files
Fix ASAN backtrace (#534)
1 parent d676363 commit a4c9d2d

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

libafl/src/observers/stacktrace.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,10 @@ impl ASANBacktraceObserver {
206206
/// parse ASAN error output emited by the target command and compute the hash
207207
pub fn parse_asan_output(&mut self, output: &str) {
208208
let mut hash = 0;
209-
let matcher = Regex::new("\\s*#[0-9]*\\s0x[0-9a-f]*\\sin\\s(.*)").unwrap();
209+
let matcher = Regex::new("\\s*#[0-9]*\\s0x([0-9a-f]*)\\s.*").unwrap();
210210
matcher.captures_iter(output).for_each(|m| {
211211
let g = m.get(1).unwrap();
212-
hash ^= g.as_str().parse::<u64>().unwrap();
213-
println!(
214-
">> {} {:#x}",
215-
g.as_str(),
216-
g.as_str().parse::<u64>().unwrap()
217-
);
212+
hash ^= u64::from_str_radix(g.as_str(), 16).unwrap();
218213
});
219214
self.update_hash(hash);
220215
}

0 commit comments

Comments
 (0)