diff options
author | Jay Foad <jay.foad@gmail.com> | 2015-06-27 08:39:12 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2015-06-27 08:39:12 +0000 |
commit | 55f65a355493f70ee707651cc298318ee7d2f476 (patch) | |
tree | 87cbb51267e17116abb13c0c84a3ac17f1b4a312 /llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp | |
parent | 9f3979fd782dc823cc0cdf38c69a14812e5254a8 (diff) | |
download | bcm5719-llvm-55f65a355493f70ee707651cc298318ee7d2f476.tar.gz bcm5719-llvm-55f65a355493f70ee707651cc298318ee7d2f476.zip |
[msan] Fix infinite recursion when _Unwind_Backtrace calls memcpy
Summary:
On PPC64, half the msan tests fail with an infinite recursion through
GetStackTrace like this:
#0 __msan::GetStackTrace
#1 __msan_memcpy
#2 ?? () from /lib64/libgcc_s.so.1
#3 ?? () from /lib64/libgcc_s.so.1
#4 _Unwind_Backtrace
#5 __sanitizer::BufferedStackTrace::SlowUnwindStack
#6 __sanitizer::BufferedStackTrace::Unwind
#7 __msan::GetStackTrace
#8 __interceptor_calloc
#9 _dl_allocate_tls
#10 pthread_create@@GLIBC_2.17
#11 __interceptor_pthread_create
#12 main
The problem is that we call _Unwind_Backtrace to get a stack trace; but
_Unwind_Backtrace calls memcpy, which we intercept and try to get
another stack trace.
This patch fixes it in __msan_memcpy by skipping the stack trace if
IsInSymbolizer(). This works because GetStackTrace already creates a
SymbolizerScope to "block reports from our interceptors during
_Unwind_Backtrace".
Reviewers: samsonov, wschmidt, eugenis
Reviewed By: eugenis
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10762
llvm-svn: 240878
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp')
0 files changed, 0 insertions, 0 deletions