From c39df60a45352fb19ae65479948e6932451b9949 Mon Sep 17 00:00:00 2001 From: Brian Caswell Date: Fri, 19 Mar 2021 23:53:40 -0400 Subject: [PATCH 1/2] add regexes from STACK_FRAME_IGNORE_REGEXES_IF_SYMBOLIZED --- src/agent/libclusterfuzz/src/generated.rs | 4 ++++ src/agent/libclusterfuzz/src/lib.rs | 1 + src/agent/libclusterfuzz/third-party/build.py | 10 ++++++---- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/agent/libclusterfuzz/src/generated.rs b/src/agent/libclusterfuzz/src/generated.rs index 4dc9a3ae93..fb5fda41a1 100644 --- a/src/agent/libclusterfuzz/src/generated.rs +++ b/src/agent/libclusterfuzz/src/generated.rs @@ -201,4 +201,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", ]; diff --git a/src/agent/libclusterfuzz/src/lib.rs b/src/agent/libclusterfuzz/src/lib.rs index 3999e21050..6c9d652f84 100644 --- a/src/agent/libclusterfuzz/src/lib.rs +++ b/src/agent/libclusterfuzz/src/lib.rs @@ -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")); } } diff --git a/src/agent/libclusterfuzz/third-party/build.py b/src/agent/libclusterfuzz/third-party/build.py index 6098a5ef38..662a0b7307 100644 --- a/src/agent/libclusterfuzz/third-party/build.py +++ b/src/agent/libclusterfuzz/third-party/build.py @@ -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: @@ -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") From 4b3ed9ece9428acec6fbc18b7133b645e0c1b1fd Mon Sep 17 00:00:00 2001 From: Brian Caswell Date: Mon, 22 Mar 2021 09:13:19 -0400 Subject: [PATCH 2/2] update from clusterfuzz --- src/agent/libclusterfuzz/src/generated.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/agent/libclusterfuzz/src/generated.rs b/src/agent/libclusterfuzz/src/generated.rs index fb5fda41a1..509c07cede 100644 --- a/src/agent/libclusterfuzz/src/generated.rs +++ b/src/agent/libclusterfuzz/src/generated.rs @@ -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",