[PATCH] [sanitizer] Expose __sanitizer_print_stack_trace().

Alexey Samsonov samsonov at google.com
Fri Nov 29 00:29:13 PST 2013

Comment at: lib/msan/msan.cc:195
@@ -194,1 +194,3 @@
+// Inlining confuses the slow unwinder in __sanitizer_print_stack_trace().
+NOINLINE void GetStackTraceNoInline(StackTrace *stack, uptr max_s, uptr pc,
How does it confuse the unwinder?

Comment at: lib/tsan/rtl/tsan_interface.cc:90
@@ -89,1 +89,3 @@
+void __sanitizer_print_stack_trace() {
interface attribute?

Comment at: include/sanitizer/common_interface_defs.h:89
@@ +88,3 @@
+  // Print the stack trace leading to this call. Useful for debugging user code.
+  void __sanitizer_print_stack_trace();
What about ubsan or dfsan implementations? If we decide to make this function tool-specific and implement it in a different way in each tool [1], let's start from the tools that need it right now (IIRC you want it for LSan/ASan).

[1] - though, I don't like it. I've spent some time to make stack unwinding and printing more generic (but apparently it's still not generic enough), and I think it would be better to fix the code in such a way that we'll be able to write a single __sanitizer_print_stack_trace in sanitizer_common that would work for all tools.


More information about the llvm-commits mailing list