Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Commit 6dc7b78

Browse files
authored
support ASAN odr-violation outputs (#380)
1 parent 7f5673e commit 6dc7b78

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
=================================================================
2+
==10896==ERROR: AddressSanitizer: odr-violation (0x7fffc6d5bd60):
3+
[1] size=64 'vtable for a::b' ../../a/b.cc
4+
[2] size=64 'vtable for a::b' ../../a/b.cc
5+
These globals were registered at these points:
6+
[1]:
7+
#0 0x555556716bcd in __asan_register_globals /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/asan/asan_globals.cpp:360:3
8+
#1 0x7fff9886d28b in asan.module_ctor (/onefuzz/blob-containers/oft-setup-b9607df0891452adabf9aab8954aa772/libviews.so+0xb0228b)
9+
10+
[2]:
11+
#0 0x555556716bcd in __asan_register_globals /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/asan/asan_globals.cpp:360:3
12+
#1 0x7fffc6d58ccb in asan.module_ctor (/onefuzz/blob-containers/oft-setup-b9607df0891452adabf9aab8954aa772/libx11_window.so+0x46ccb)
13+
14+
==10896==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
15+
SUMMARY: AddressSanitizer: odr-violation: global 'vtable for a::b' at ../../a/b.cc
16+
==10896==ABORTING

src/agent/onefuzz/src/asan.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ fn parse_asan_runtime_error(text: &str) -> Option<(String, String, String)> {
9797
}
9898

9999
fn parse_summary(text: &str) -> Option<(String, String, String)> {
100-
let pattern = r"SUMMARY: ((\w+): (data race|deadly signal|[^ \n]+).*)";
100+
let pattern = r"SUMMARY: ((\w+): (data race|deadly signal|odr-violation|[^ \n]+).*)";
101101
let re = Regex::new(pattern).ok()?;
102102
let captures = re.captures(text)?;
103103
let summary = captures.get(1)?.as_str().trim();
@@ -315,6 +315,14 @@ mod tests {
315315
Some(51),
316316
Some("4-byte-write-stack-buffer-underflow".to_string()),
317317
),
318+
(
319+
"data/asan-odr-violation.txt",
320+
"AddressSanitizer",
321+
"odr-violation",
322+
2,
323+
None,
324+
None,
325+
),
318326
];
319327

320328
for (

0 commit comments

Comments
 (0)