|
From: Nicholas N. <nj...@ca...> - 2004-10-26 16:30:05
|
CVS commit by nethercote:
Tweak as_mmap for the possibility of a PIE-supporting system with a 4GB user
space.
A filter_as_mmap 1.1
M +1 -1 Makefile.am 1.25
M +14 -5 as_mmap.c 1.2 [POSSIBLY UNSAFE: printf]
M +11 -6 as_mmap.stderr.exp 1.2
M +5 -0 as_mmap.stderr.exp2 1.2
M +1 -0 as_mmap.vgtest 1.2
--- valgrind/corecheck/tests/Makefile.am #1.24:1.25
@@ -5,5 +5,5 @@
##---------------------------------------------------------------------------
-noinst_SCRIPTS = filter_stderr filter_fdleak
+noinst_SCRIPTS = filter_stderr filter_as_mmap filter_fdleak
EXTRA_DIST = $(noinst_SCRIPTS) \
--- valgrind/corecheck/tests/as_mmap.c #1.1:1.2
@@ -7,19 +7,28 @@ int main()
char *top = (char *)(((unsigned long)&local + 0x0fffffff) & ~0x0fffffff);
+ fprintf(stderr, "1\n");
if (mmap((void *)0x00000000, 0x10000, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANON|MAP_FIXED, -1, 0) == MAP_FAILED)
- perror("mmap @ 0x00000000");
+ fprintf(stderr, "mmap @ 0x00000000\n");
+
+ fprintf(stderr, "2\n");
if (mmap((void *)0x00010000, 0x10000, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANON|MAP_FIXED, -1, 0) == MAP_FAILED)
- perror("mmap @ 0x00010000");
+ fprintf(stderr, "mmap @ 0x00010000\n");
+
+ fprintf(stderr, "3\n");
if (mmap((void *)0x50000000, 0x10000, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANON|MAP_FIXED, -1, 0) == MAP_FAILED)
- perror("mmap @ 0x50000000");
+ fprintf(stderr, "mmap @ 0x50000000\n");
+
+ fprintf(stderr, "4\n");
if (mmap(top, 0x10000, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANON|MAP_FIXED, -1, 0) == MAP_FAILED)
- perror("mmap @ top");
+ fprintf(stderr, "mmap @ top\n");
+
+ fprintf(stderr, "5\n");
if (mmap(top+0x08000000, 0x10000, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANON|MAP_FIXED, -1, 0) == MAP_FAILED)
- perror("mmap @ top+.5G");
+ fprintf(stderr, "mmap @ top+.5G\n");
return 0;
--- valgrind/corecheck/tests/as_mmap.stderr.exp #1.1:1.2
@@ -1,9 +1,14 @@
-Warning: client syscall mmap2 tried to modify addresses 0x0-0x10000
-mmap @ 0x00000000: Cannot allocate memory
-Warning: client syscall mmap2 tried to modify addresses 0xB0000000-0xB0010000
-mmap @ top: Cannot allocate memory
-Warning: client syscall mmap2 tried to modify addresses 0xB8000000-0xB8010000
-mmap @ top+.5G: Cannot allocate memory
+1
+Warning: client syscall mmap2 tried to modify addresses 0x........-0x........
+mmap @ 0x........
+2
+3
+4
+Warning: client syscall mmap2 tried to modify addresses 0x........-0x........
+mmap @ top
+5
+Warning: client syscall mmap2 tried to modify addresses 0x........-0x........
+mmap @ top+.5G
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
--- valgrind/corecheck/tests/as_mmap.stderr.exp2 #1.1:1.2
@@ -1,7 +1,12 @@
+1
Warning: client syscall mmap tried to modify addresses 0x0-0x10000
mmap @ 0x00000000: Cannot allocate memory
+2
+3
+4
Warning: client syscall mmap tried to modify addresses 0xB0000000-0xB0010000
mmap @ top: Cannot allocate memory
+5
Warning: client syscall mmap tried to modify addresses 0xB8000000-0xB8010000
mmap @ top+.5G: Cannot allocate memory
--- valgrind/corecheck/tests/as_mmap.vgtest #1.1:1.2
@@ -1 +1,2 @@
prog: as_mmap
+stderr_filter: filter_as_mmap
|