[PATCH] D19148: Always inlining PrintCurrentStackSlow of tsan library to fix tail-call issue

Chuang-Yu Cheng via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 20 03:22:24 PDT 2016


cycheng updated the summary for this revision.
cycheng updated this revision to Diff 54338.

http://reviews.llvm.org/D19148

Files:
  lib/tsan/rtl/tsan_rtl_report.cc

Index: lib/tsan/rtl/tsan_rtl_report.cc
===================================================================
--- lib/tsan/rtl/tsan_rtl_report.cc
+++ lib/tsan/rtl/tsan_rtl_report.cc
@@ -680,6 +680,14 @@
   PrintStack(SymbolizeStack(trace));
 }
 
+// Always inlining PrintCurrentStackSlow, because LocatePcInTrace assumes
+// __sanitizer_print_stack_trace exists in the actual unwinded stack, but
+// tail-call to PrintCurrentStackSlow breaks this assumption because
+// __sanitizer_print_stack_trace disappears after tail-call.
+// However, this solution is not reliable enough, please see dvyukov's comment
+// http://reviews.llvm.org/D19148#406208
+// Also see PR27280 comment 2 and 3 for breaking examples and analysis.
+ALWAYS_INLINE
 void PrintCurrentStackSlow(uptr pc) {
 #ifndef SANITIZER_GO
   BufferedStackTrace *ptrace =


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19148.54338.patch
Type: text/x-patch
Size: 828 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160420/4db5b81c/attachment.bin>


More information about the llvm-commits mailing list