|
From: <sv...@va...> - 2011-10-04 20:19:45
|
Author: florian
Date: 2011-10-04 21:14:59 +0100 (Tue, 04 Oct 2011)
New Revision: 12097
Log:
Rewrite badjump and badjump2 such that the error occurs now on the
same line for all architectures.
Promote the s390x exp file to be the golden one because it has the
correct result. Add exp-kfail files for those platforms where the testcases
fail (x86).
Added:
trunk/memcheck/tests/badjump.stderr.exp-kfail
trunk/memcheck/tests/badjump2.stderr.exp-kfail
Removed:
trunk/memcheck/tests/badjump.stderr.exp-s390x
trunk/memcheck/tests/badjump2.stderr.exp-s390x
Modified:
trunk/memcheck/tests/badjump.c
trunk/memcheck/tests/badjump.stderr.exp
trunk/memcheck/tests/badjump2.c
trunk/memcheck/tests/badjump2.stderr.exp
Modified: trunk/memcheck/tests/badjump.c
===================================================================
--- trunk/memcheck/tests/badjump.c 2011-10-04 16:53:34 UTC (rev 12096)
+++ trunk/memcheck/tests/badjump.c 2011-10-04 20:14:59 UTC (rev 12097)
@@ -7,14 +7,13 @@
descriptor, not to the function's entry point. Hence to get
uniform behaviour on all supported targets - a jump to an
unmapped page - the following is needed. */
- unsigned long long int fake_fndescr[3];
- fake_fndescr[0] = (unsigned long long int)get_unmapped_page();
- fake_fndescr[1] = 0;
- fake_fndescr[2] = 0;
- return ((int(*)(void)) fake_fndescr) ();
+ unsigned long long int p[3];
+ p[0] = (unsigned long long int)get_unmapped_page();
+ p[1] = 0;
+ p[2] = 0;
#else
char* p = get_unmapped_page();
- return ((int(*)(void)) p) ();
#endif
+ return ((int(*)(void)) p) ();
}
Modified: trunk/memcheck/tests/badjump.stderr.exp
===================================================================
--- trunk/memcheck/tests/badjump.stderr.exp 2011-10-04 16:53:34 UTC (rev 12096)
+++ trunk/memcheck/tests/badjump.stderr.exp 2011-10-04 20:14:59 UTC (rev 12097)
@@ -1,12 +1,14 @@
Jump to the invalid address stated on the next line
...
+ by 0x........: main (badjump.c:17)
Address 0x........ is not stack'd, malloc'd or (recently) free'd
Process terminating with default action of signal 11 (SIGSEGV)
Access not within mapped region at address 0x........
...
+ by 0x........: main (badjump.c:17)
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
Added: trunk/memcheck/tests/badjump.stderr.exp-kfail
===================================================================
--- trunk/memcheck/tests/badjump.stderr.exp-kfail (rev 0)
+++ trunk/memcheck/tests/badjump.stderr.exp-kfail 2011-10-04 20:14:59 UTC (rev 12097)
@@ -0,0 +1,23 @@
+
+Jump to the invalid address stated on the next line
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+
+Process terminating with default action of signal 11 (SIGSEGV)
+ Access not within mapped region at address 0x........
+ ...
+ 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 ....
+
+HEAP SUMMARY:
+ in use at exit: ... bytes in ... blocks
+ total heap usage: ... allocs, ... frees, ... bytes allocated
+
+For a detailed leak analysis, rerun with: --leak-check=full
+
+For counts of detected and suppressed errors, rerun with: -v
+ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Deleted: trunk/memcheck/tests/badjump.stderr.exp-s390x
===================================================================
--- trunk/memcheck/tests/badjump.stderr.exp-s390x 2011-10-04 16:53:34 UTC (rev 12096)
+++ trunk/memcheck/tests/badjump.stderr.exp-s390x 2011-10-04 20:14:59 UTC (rev 12097)
@@ -1,25 +0,0 @@
-
-Jump to the invalid address stated on the next line
- ...
- by 0x........: main (badjump.c:17)
- Address 0x........ is not stack'd, malloc'd or (recently) free'd
-
-
-Process terminating with default action of signal 11 (SIGSEGV)
- Access not within mapped region at address 0x........
- ...
- by 0x........: main (badjump.c:17)
- 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 ....
-
-HEAP SUMMARY:
- in use at exit: ... bytes in ... blocks
- total heap usage: ... allocs, ... frees, ... bytes allocated
-
-For a detailed leak analysis, rerun with: --leak-check=full
-
-For counts of detected and suppressed errors, rerun with: -v
-ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Modified: trunk/memcheck/tests/badjump2.c
===================================================================
--- trunk/memcheck/tests/badjump2.c 2011-10-04 16:53:34 UTC (rev 12096)
+++ trunk/memcheck/tests/badjump2.c 2011-10-04 20:14:59 UTC (rev 12097)
@@ -36,15 +36,14 @@
if (__builtin_setjmp(myjmpbuf) == 0) {
// Jump to zero; will cause seg fault
#if defined(__powerpc64__)
- unsigned long int fake_fndescr[3];
- fake_fndescr[0] = 0;
- fake_fndescr[1] = 0;
- fake_fndescr[2] = 0;
- ((void(*)(void)) fake_fndescr) ();
+ unsigned long int fn[3];
+ fn[0] = 0;
+ fn[1] = 0;
+ fn[2] = 0;
#else
void (*fn)(void) = 0;
- fn();
#endif
+ ((void(*)(void)) fn) ();
fprintf(stderr, "Got here??\n");
} else {
fprintf(stderr, "Signal caught, as expected\n");
Modified: trunk/memcheck/tests/badjump2.stderr.exp
===================================================================
--- trunk/memcheck/tests/badjump2.stderr.exp 2011-10-04 16:53:34 UTC (rev 12096)
+++ trunk/memcheck/tests/badjump2.stderr.exp 2011-10-04 20:14:59 UTC (rev 12097)
@@ -1,5 +1,6 @@
Jump to the invalid address stated on the next line
...
+ by 0x........: main (badjump2.c:46)
Address 0x........ is not stack'd, malloc'd or (recently) free'd
Signal caught, as expected
Added: trunk/memcheck/tests/badjump2.stderr.exp-kfail
===================================================================
--- trunk/memcheck/tests/badjump2.stderr.exp-kfail (rev 0)
+++ trunk/memcheck/tests/badjump2.stderr.exp-kfail 2011-10-04 20:14:59 UTC (rev 12097)
@@ -0,0 +1,5 @@
+Jump to the invalid address stated on the next line
+ ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+
+Signal caught, as expected
Deleted: trunk/memcheck/tests/badjump2.stderr.exp-s390x
===================================================================
--- trunk/memcheck/tests/badjump2.stderr.exp-s390x 2011-10-04 16:53:34 UTC (rev 12096)
+++ trunk/memcheck/tests/badjump2.stderr.exp-s390x 2011-10-04 20:14:59 UTC (rev 12097)
@@ -1,6 +0,0 @@
-Jump to the invalid address stated on the next line
- ...
- by 0x........: main (badjump2.c:46)
- Address 0x........ is not stack'd, malloc'd or (recently) free'd
-
-Signal caught, as expected
|