Commit 3d61d875 by Bill Schmidt Committed by William Schmidt

re PR sanitizer/63927 (AddressSanitizer painfully slow on ppc64)

2015-07-28  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR sanitizer/63927
	* sanitizer_common/sanitizer_stacktrace.cc
	(BufferedStackTrace::FastUnwindStack): Fix code for PowerPC to
	find the link register at an offset of 16 from the base of the
	caller's stack frame.

From-SVN: r226335
parent c73858e9
2015-07-28 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR sanitizer/63927
* sanitizer_common/sanitizer_stacktrace.cc
(BufferedStackTrace::FastUnwindStack): Fix code for PowerPC to
find the link register at an offset of 16 from the base of the
caller's stack frame.
2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com> 2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>
* Makefile.in: Regenerated with automake-1.11.6. * Makefile.in: Regenerated with automake-1.11.6.
......
...@@ -86,7 +86,18 @@ void BufferedStackTrace::FastUnwindStack(uptr pc, uptr bp, uptr stack_top, ...@@ -86,7 +86,18 @@ void BufferedStackTrace::FastUnwindStack(uptr pc, uptr bp, uptr stack_top,
while (IsValidFrame((uptr)frame, stack_top, bottom) && while (IsValidFrame((uptr)frame, stack_top, bottom) &&
IsAligned((uptr)frame, sizeof(*frame)) && IsAligned((uptr)frame, sizeof(*frame)) &&
size < max_depth) { size < max_depth) {
#ifdef __powerpc__
// PowerPC ABIs specify that the return address is saved at offset
// 16 of the *caller's* stack frame. Thus we must dereference the
// back chain to find the caller frame before extracting it.
uhwptr *caller_frame = (uhwptr*)frame[0];
if (!IsValidFrame((uptr)caller_frame, stack_top, bottom) ||
!IsAligned((uptr)caller_frame, sizeof(uhwptr)))
break;
uhwptr pc1 = caller_frame[2];
#else
uhwptr pc1 = frame[1]; uhwptr pc1 = frame[1];
#endif
if (pc1 != pc) { if (pc1 != pc) {
trace_buffer[size++] = (uptr) pc1; trace_buffer[size++] = (uptr) pc1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment