]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libsanitizer: Improve FrameIsInternal
authorKito Cheng <kito.cheng@sifive.com>
Wed, 6 Nov 2024 09:35:46 +0000 (17:35 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Tue, 12 Nov 2024 13:56:06 +0000 (21:56 +0800)
`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.

libsanitizer/sanitizer_common/sanitizer_symbolizer_report.cpp

index 351e00db6fb2dc9920c8b5b215d1741ed285a075..80ae31e938ae76b81e8d08ffa2bff1bcb7b404e2 100644 (file)
@@ -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;
 }