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

add regexes from STACK_FRAME_IGNORE_REGEXES_IF_SYMBOLIZED #706

Merged
3 commits merged into from
Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")