Skip to content

Commit

Permalink
add regexes from STACK_FRAME_IGNORE_REGEXES_IF_SYMBOLIZED (microsoft#706
Browse files Browse the repository at this point in the history
)
  • Loading branch information
bmc-msft authored Mar 22, 2021
1 parent c0d7381 commit cf6c4e5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/agent/libclusterfuzz/src/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ pub const STACK_FRAME_IGNORE_REGEXES: &[&str] = &[
r"^pthread_kill$",
r"^raise$",
r"^tgkill$",
r"^__chk_fail$",
r"^__fortify_fail$",
r"^(|__)aeabi_",
r"^(|__)memcmp",
r"^(|__)memcpy",
Expand Down Expand Up @@ -201,4 +203,8 @@ pub const STACK_FRAME_IGNORE_REGEXES: &[&str] = &[
r"^syslog::LogMessage",
r"^print_address_description",
r"^_etext",
r".*libc\.so",
r".*libc\+\+\.so",
r".*libc\+\+_shared\.so",
r".*libstdc\+\+\.so",
];
1 change: 1 addition & 0 deletions src/agent/libclusterfuzz/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ mod tests {
fn test_stack_filter() {
assert!(get_stack_filter().is_match("abort"));
assert!(!get_stack_filter().is_match("ContosoSaysHi"));
assert!(get_stack_filter().is_match("libc.so"));
}
}
10 changes: 6 additions & 4 deletions src/agent/libclusterfuzz/third-party/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@
data[name] = entry

for_rust = {
"STACK_FRAME_IGNORE_REGEXES": [
f'r"{x}"' for x in data["STACK_FRAME_IGNORE_REGEXES"]
],
# since we always assume symbolication, combine these
"STACK_FRAME_IGNORE_REGEXES": (
[f'r"{x}"' for x in data["STACK_FRAME_IGNORE_REGEXES"]]
+ [f'r"{x}"' for x in data["STACK_FRAME_IGNORE_REGEXES_IF_SYMBOLIZED"]]
),
}

with open("../src/generated.rs", "w") as handle:
Expand All @@ -66,4 +68,4 @@
value = for_rust[key]
handle.write(f"pub const {key}: &str = {value};")
else:
raise Exception('unsupported for_rust type')
raise Exception("unsupported for_rust type")

0 comments on commit cf6c4e5

Please sign in to comment.