Useful for debugging code built with sanitizer tools.
Details
Diff Detail
Event Timeline
include/sanitizer/common_interface_defs.h | ||
---|---|---|
88 | Specify that this is useful for debugging purposes only. | |
lib/sanitizer_common/sanitizer_common_libcdep.cc | ||
41 | Looks like this should go to sanitizer_stacktrace_libcdep.cc | |
45 | What if slow unwind is unavailable (caller can learn about this via StackTrace::WillUseFastUnwind function)? You'll also need lit tests. |
include/sanitizer/common_interface_defs.h | ||
---|---|---|
89 | 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. | |
lib/msan/msan.cc | ||
195 ↗ | (On Diff #5814) | How does it confuse the unwinder? |
lib/tsan/rtl/tsan_interface.cc | ||
90 ↗ | (On Diff #5814) | interface attribute? |
lib/msan/msan.cc | ||
---|---|---|
195 ↗ | (On Diff #5814) | Like this: #0 0x7fef07e475a8 in __sanitizer_print_stack_trace llvm/projects/compiler-rt/lib/msan/msan.cc:578 #1 0x7fef07e47658 in GetStackTrace san/llvm/projects/compiler-rt/lib/msan/msan.cc:188 #2 0x7fef07e47658 in __sanitizer_print_stack_trace llvm/projects/compiler-rt/lib/msan/msan.cc:579 #3 0x7fef07e8b2e1 in main (reproducers/a.out+0x602e1) #4 0x7fef06a2c76c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226 #5 0x7fef07e8b1d4 in _start (reproducers/a.out+0x601d4) |
The patch doesn't seem to work for me if I add __sanitizer_print_stack_trace() into BlockingMutex::{Lock,Unlock} in sanitizer_common/sanitizer_linux.cc
lib/asan/asan_stack.cc | ||
---|---|---|
49 ↗ | (On Diff #5852) | Can we instead use asan:: in sanitizer_print_stack_trace (and probably in GET_STACK_TRACE_) macro expansions? |
lib/asan/lit_tests/TestCases/print-stack-trace.cc | ||
2 ↗ | (On Diff #5852) | I think you may just leave -O0 and -O3 here. |
16 ↗ | (On Diff #5852) | Remove trailing .* |
Specify that this is useful for debugging purposes only.