|
From: <sv...@va...> - 2009-02-26 22:36:20
|
Author: njn
Date: 2009-02-26 22:36:14 +0000 (Thu, 26 Feb 2009)
New Revision: 9285
Log:
In memcheck/tests/match-overrun.c, don't assume anything about the memory
layout at address 0x0.
Also, it really looks like this test is meant to be testing wildcard
matching in suppressions. So I rewrote the suppression so it actually
works.
The test now succeeds on Darwin.
Modified:
branches/DARWIN/memcheck/tests/match-overrun.c
branches/DARWIN/memcheck/tests/match-overrun.stderr.exp
branches/DARWIN/memcheck/tests/match-overrun.supp
branches/DARWIN/memcheck/tests/match-overrun.vgtest
Modified: branches/DARWIN/memcheck/tests/match-overrun.c
===================================================================
--- branches/DARWIN/memcheck/tests/match-overrun.c 2009-02-26 22:26:45 UTC (rev 9284)
+++ branches/DARWIN/memcheck/tests/match-overrun.c 2009-02-26 22:36:14 UTC (rev 9285)
@@ -1,9 +1,12 @@
#include <stdio.h>
#include <stdlib.h>
+#include "memcheck/memcheck.h"
static int a1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789(void)
{
- return *(int *)0;
+ int x;
+ VALGRIND_MAKE_MEM_NOACCESS(&x, sizeof(x));
+ return *(int *)&x;
}
int main(int argc, char **argv)
Modified: branches/DARWIN/memcheck/tests/match-overrun.stderr.exp
===================================================================
--- branches/DARWIN/memcheck/tests/match-overrun.stderr.exp 2009-02-26 22:26:45 UTC (rev 9284)
+++ branches/DARWIN/memcheck/tests/match-overrun.stderr.exp 2009-02-26 22:36:14 UTC (rev 9285)
@@ -1,16 +0,0 @@
-
-
-Process terminating with default action of signal 11 (SIGSEGV)
- Access not within mapped region at address 0x........
- at 0x........: a1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 (match-overrun.c:6)
- by 0x........: main (match-overrun.c:11)
- If you believe this happened as a result of a stack overflow in your
- program's main thread (unlikely but possible), you can try to increase
- the size of the main thread stack using the --main-stacksize= flag.
- The main thread stack size used in this run was ....
-
-ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
-malloc/free: in use at exit: ... bytes in ... blocks.
-malloc/free: ... allocs, ... frees, ... bytes allocated.
-For a detailed leak analysis, rerun with: --leak-check=yes
-For counts of detected errors, rerun with: -v
Modified: branches/DARWIN/memcheck/tests/match-overrun.supp
===================================================================
--- branches/DARWIN/memcheck/tests/match-overrun.supp 2009-02-26 22:26:45 UTC (rev 9284)
+++ branches/DARWIN/memcheck/tests/match-overrun.supp 2009-02-26 22:36:14 UTC (rev 9285)
@@ -2,4 +2,5 @@
test
Memcheck:Addr4
fun:a123456789*
+ fun:main
}
Modified: branches/DARWIN/memcheck/tests/match-overrun.vgtest
===================================================================
--- branches/DARWIN/memcheck/tests/match-overrun.vgtest 2009-02-26 22:26:45 UTC (rev 9284)
+++ branches/DARWIN/memcheck/tests/match-overrun.vgtest 2009-02-26 22:36:14 UTC (rev 9285)
@@ -1,3 +1,3 @@
prog: match-overrun
-vgopts: --suppressions=match-overrun.supp
+vgopts: -q --suppressions=match-overrun.supp
stderr_filter: filter_allocs
|