diff mbox series

[3/4] libsanitizer: Improve FrameIsInternal

Message ID 20241107063538.4172543-4-kito.cheng@sifive.com
State New
Headers show
Series libsanitizer: merge from upstream | expand

Commit Message

Kito Cheng Nov. 7, 2024, 6:35 a.m. UTC
`FrameIsInternal` is a function that improves report quality by filtering out
internal functions from the sanitizer, allowing it to point to a more precise
root cause. However, the current checks are mostly specific to compiler-rt,
so we are adding a few more rules to enhance the filtering for libsanitizer as
well.
---
 .../sanitizer_common/sanitizer_symbolizer_report.cpp      | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/libsanitizer/sanitizer_common/sanitizer_symbolizer_report.cpp b/libsanitizer/sanitizer_common/sanitizer_symbolizer_report.cpp
index 351e00db6fb2..6f68e484ac90 100644
--- a/libsanitizer/sanitizer_common/sanitizer_symbolizer_report.cpp
+++ b/libsanitizer/sanitizer_common/sanitizer_symbolizer_report.cpp
@@ -41,10 +41,18 @@  static bool FrameIsInternal(const SymbolizedStack *frame) {
     return true;
   if (file && internal_strstr(file, "\\compiler-rt\\lib\\"))
     return true;
+  if (file && internal_strstr(file, "\\libsanitizer\\"))
+    return true;
   if (module && (internal_strstr(module, "libclang_rt.")))
     return true;
   if (module && (internal_strstr(module, "clang_rt.")))
     return true;
+  if (module && (internal_strstr(module, "libtsan.")
+		 || internal_strstr(module, "libhwasan.")
+		 || internal_strstr(module, "liblsan.")
+		 || internal_strstr(module, "libasan.")
+		 || internal_strstr(module, "libubsan."))
+    return true;
   return false;
 }