mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 10:05:29 +00:00
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). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12097
This commit is contained in:
parent
1816005ef7
commit
8d6e98bdfd
@ -7,14 +7,13 @@ int main ( void )
|
|||||||
descriptor, not to the function's entry point. Hence to get
|
descriptor, not to the function's entry point. Hence to get
|
||||||
uniform behaviour on all supported targets - a jump to an
|
uniform behaviour on all supported targets - a jump to an
|
||||||
unmapped page - the following is needed. */
|
unmapped page - the following is needed. */
|
||||||
unsigned long long int fake_fndescr[3];
|
unsigned long long int p[3];
|
||||||
fake_fndescr[0] = (unsigned long long int)get_unmapped_page();
|
p[0] = (unsigned long long int)get_unmapped_page();
|
||||||
fake_fndescr[1] = 0;
|
p[1] = 0;
|
||||||
fake_fndescr[2] = 0;
|
p[2] = 0;
|
||||||
return ((int(*)(void)) fake_fndescr) ();
|
|
||||||
#else
|
#else
|
||||||
char* p = get_unmapped_page();
|
char* p = get_unmapped_page();
|
||||||
return ((int(*)(void)) p) ();
|
|
||||||
#endif
|
#endif
|
||||||
|
return ((int(*)(void)) p) ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,14 @@
|
|||||||
|
|
||||||
Jump to the invalid address stated on the next line
|
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
|
Address 0x........ is not stack'd, malloc'd or (recently) free'd
|
||||||
|
|
||||||
|
|
||||||
Process terminating with default action of signal 11 (SIGSEGV)
|
Process terminating with default action of signal 11 (SIGSEGV)
|
||||||
Access not within mapped region at address 0x........
|
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
|
If you believe this happened as a result of a stack
|
||||||
overflow in your program's main thread (unlikely but
|
overflow in your program's main thread (unlikely but
|
||||||
possible), you can try to increase the size of the
|
possible), you can try to increase the size of the
|
||||||
|
|||||||
@ -1,14 +1,12 @@
|
|||||||
|
|
||||||
Jump to the invalid address stated on the next line
|
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
|
Address 0x........ is not stack'd, malloc'd or (recently) free'd
|
||||||
|
|
||||||
|
|
||||||
Process terminating with default action of signal 11 (SIGSEGV)
|
Process terminating with default action of signal 11 (SIGSEGV)
|
||||||
Access not within mapped region at address 0x........
|
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
|
If you believe this happened as a result of a stack
|
||||||
overflow in your program's main thread (unlikely but
|
overflow in your program's main thread (unlikely but
|
||||||
possible), you can try to increase the size of the
|
possible), you can try to increase the size of the
|
||||||
@ -36,15 +36,14 @@ int main(void)
|
|||||||
if (__builtin_setjmp(myjmpbuf) == 0) {
|
if (__builtin_setjmp(myjmpbuf) == 0) {
|
||||||
// Jump to zero; will cause seg fault
|
// Jump to zero; will cause seg fault
|
||||||
#if defined(__powerpc64__)
|
#if defined(__powerpc64__)
|
||||||
unsigned long int fake_fndescr[3];
|
unsigned long int fn[3];
|
||||||
fake_fndescr[0] = 0;
|
fn[0] = 0;
|
||||||
fake_fndescr[1] = 0;
|
fn[1] = 0;
|
||||||
fake_fndescr[2] = 0;
|
fn[2] = 0;
|
||||||
((void(*)(void)) fake_fndescr) ();
|
|
||||||
#else
|
#else
|
||||||
void (*fn)(void) = 0;
|
void (*fn)(void) = 0;
|
||||||
fn();
|
|
||||||
#endif
|
#endif
|
||||||
|
((void(*)(void)) fn) ();
|
||||||
fprintf(stderr, "Got here??\n");
|
fprintf(stderr, "Got here??\n");
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Signal caught, as expected\n");
|
fprintf(stderr, "Signal caught, as expected\n");
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
Jump to the invalid address stated on the next line
|
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
|
Address 0x........ is not stack'd, malloc'd or (recently) free'd
|
||||||
|
|
||||||
Signal caught, as expected
|
Signal caught, as expected
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
Jump to the invalid address stated on the next line
|
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
|
Address 0x........ is not stack'd, malloc'd or (recently) free'd
|
||||||
|
|
||||||
Signal caught, as expected
|
Signal caught, as expected
|
||||||
Loading…
x
Reference in New Issue
Block a user