[PATCH] D14813: [tsan] Recognize frames coming from "libclang_rt.tsan_*" module as internal

Kuba Brecka via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 19 02:15:41 PST 2015


kubabrecka created this revision.
kubabrecka added reviewers: dvyukov, kcc, glider, samsonov.
kubabrecka added subscribers: llvm-commits, zaks.anna, ismailp.

On OS X, we build a dylib of the TSan runtime, which doesn't necessarily need to contain debugging symbols (and file and line information), so llvm-symbolizer might not be able to find file names for TSan internal frames.  `FrameIsInternal` currently only considers filenames, but we should simply treat all frames within `libclang_rt.tsan_osx_dynamic.dylib` as internal.  This patch treats all modules starting with `libclang_rt.tsan_` as internal, because there may be more runtimes for other platforms in the future.

Also, this fixes one test failure on OS X.

http://reviews.llvm.org/D14813

Files:
  lib/tsan/rtl/tsan_report.cc

Index: lib/tsan/rtl/tsan_report.cc
===================================================================
--- lib/tsan/rtl/tsan_report.cc
+++ lib/tsan/rtl/tsan_report.cc
@@ -267,10 +267,15 @@
   if (frame == 0)
     return false;
   const char *file = frame->info.file;
-  return file != 0 &&
-         (internal_strstr(file, "tsan_interceptors.cc") ||
-          internal_strstr(file, "sanitizer_common_interceptors.inc") ||
-          internal_strstr(file, "tsan_interface_"));
+  const char *module = frame->info.module;
+  if (file != 0 &&
+      (internal_strstr(file, "tsan_interceptors.cc") ||
+       internal_strstr(file, "sanitizer_common_interceptors.inc") ||
+       internal_strstr(file, "tsan_interface_")))
+    return true;
+  if (module != 0 && (internal_strstr(module, "libclang_rt.tsan_")))
+    return true;
+  return false;
 }
 
 static SymbolizedStack *SkipTsanInternalFrames(SymbolizedStack *frames) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14813.40617.patch
Type: text/x-patch
Size: 922 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151119/cfd17722/attachment.bin>


More information about the llvm-commits mailing list