|
From: Christian B. <bor...@de...> - 2010-12-15 14:16:10
|
On s390x the translation exception only provides us with the page address,
but not the offset within the page. We need to consider this hardware
attribute in extend_stack_if_appropriate to let valgrind map the stack.
---
coregrind/m_signals.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- valgrind-upstream.orig/coregrind/m_signals.c
+++ valgrind-upstream/coregrind/m_signals.c
@@ -2247,7 +2247,10 @@ static Bool extend_stack_if_appropriate(
&& seg_next
&& seg_next->kind == SkAnonC
&& seg->end+1 == seg_next->start
- && fault >= (esp - VG_STACK_REDZONE_SZB)) {
+ /* We have to use VG_PGROUNDDN because faults on s390x only deliver
+ the page address but not the address within a page.
+ */
+ && fault >= VG_PGROUNDDN(esp - VG_STACK_REDZONE_SZB)) {
/* If the fault address is above esp but below the current known
stack segment base, and it was a fault because there was
nothing mapped there (as opposed to a permissions fault),
|