[compiler-rt] r266371 - [sanitizer] [SystemZ] Fix stack traces.
Marcin Koscielnicki via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 14 14:19:27 PDT 2016
Author: koriakin
Date: Thu Apr 14 16:19:27 2016
New Revision: 266371
URL: http://llvm.org/viewvc/llvm-project?rev=266371&view=rev
Log:
[sanitizer] [SystemZ] Fix stack traces.
On s390, the return address is in %r14, which is saved 14 words from
the frame pointer.
Unfortunately, there's no way to do a proper fast backtrace on SystemZ
with current LLVM - the saved %r15 in fixed-layout register save
area points to the containing frame itself, and not to the next one.
Likewise for %r11 - it's identical to %r15, unless alloca is used
(and even if it is, it's still useless). There's just no way to
determine frame size / next frame pointer. -mbackchain would fix that
(and make the current code just work), but that's not yet supported
in LLVM. We will thus need to XFAIL some asan tests
(Linux/stack-trace-dlclose.cc, deep_stack_uaf.cc).
Differential Revision: http://reviews.llvm.org/D18895
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc?rev=266371&r1=266370&r2=266371&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc Thu Apr 14 16:19:27 2016
@@ -92,6 +92,8 @@ void BufferedStackTrace::FastUnwindStack
!IsAligned((uptr)caller_frame, sizeof(uhwptr)))
break;
uhwptr pc1 = caller_frame[2];
+#elif defined(__s390__)
+ uhwptr pc1 = frame[14];
#else
uhwptr pc1 = frame[1];
#endif
More information about the llvm-commits
mailing list