|
From: <sv...@va...> - 2006-08-16 01:50:58
|
Author: sewardj
Date: 2006-08-16 02:50:55 +0100 (Wed, 16 Aug 2006)
New Revision: 6002
Log:
Regtest for bug fixed by r6001.
Added:
trunk/none/tests/amd64/nibz_bennee_mmap.c
trunk/none/tests/amd64/nibz_bennee_mmap.stderr.exp
trunk/none/tests/amd64/nibz_bennee_mmap.stdout.exp
trunk/none/tests/amd64/nibz_bennee_mmap.vgtest
Modified:
trunk/none/tests/amd64/Makefile.am
Modified: trunk/none/tests/amd64/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/amd64/Makefile.am 2006-08-16 01:48:19 UTC (rev 6001)
+++ trunk/none/tests/amd64/Makefile.am 2006-08-16 01:50:55 UTC (rev 6002)
@@ -14,13 +14,16 @@
$(addsuffix .vgtest,$(INSN_TESTS)) \
jrcxz.stderr.exp jrcxz.stdout.exp jrcxz.vgtest \
looper.stderr.exp looper.stdout.exp looper.vgtest \
+ nibz_bennee_mmap.stderr.exp nibz_bennee_mmap.stdout.exp=20
+ nibz_bennee_mmap.vgtest \
smc1.stderr.exp smc1.stdout.exp smc1.vgtest \
shrld.stderr.exp shrld.stdout.exp shrld.vgtest
=20
=20
check_PROGRAMS =3D \
clc \
- faultstatus fcmovnu fxtract $(INSN_TESTS) looper jrcxz smc1 shrld
+ faultstatus fcmovnu fxtract $(INSN_TESTS) looper jrcxz smc1 shrld \
+ nibz_bennee_mmap
=20
AM_CFLAGS =3D $(WERROR) -Winline -Wall -Wshadow -g -I$(top_srcdir)/inc=
lude
@FLAG_M64@
Added: trunk/none/tests/amd64/nibz_bennee_mmap.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/amd64/nibz_bennee_mmap.c (re=
v 0)
+++ trunk/none/tests/amd64/nibz_bennee_mmap.c 2006-08-16 01:50:55 UTC (re=
v 6002)
@@ -0,0 +1,61 @@
+
+/* Test for aspacem bug reported by Alex Bennee, reported on users
+ list around 9 Aug 06, resulting in
+
+ > > --1515:0:aspacem Valgrind: FATAL: aspacem assertion failed:
+ > > --1515:0:aspacem holeEnd <=3D aspacem_maxAddr
+ > > --1515:0:aspacem at m_aspacemgr/aspacemgr.c:1998
+ > > (vgPlain_am_get_advisory)
+ > > --1515:0:aspacem Exiting now.
+
+ TomH writes:
+
+ > I think the problem here is that you've done an mmap (either fixed =
or
+ > hinted) above aspacem_maxAddr and then munmaped it which leaves you
+ > with a free segment above aspacem_maxAddr.
+
+ The sequence seems to be that you have to allocate memory somewhere
+ above aspacem_maxAddr, then free it, then do another hinted
+ allocation that is above aspacem_maxAddr but which can't be done
+ due to the memory already being in use. This program will reproduce
+ it.
+
+ On investigation: the problem was the munmap returns its space in
+ the form of SkFree even though the space above aspacem_maxAddr is
+ supposed to be SkResvn. This is now fixed.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/mman.h>
+
+int main(int argc, char **argv)
+{
+ void *p;
+ if ((p =3D mmap((void*)0x1F7F100000, 4096, PROT_READ|PROT_WRITE,
+ MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0)) =3D=3D (vo=
id *)-1)
+ {
+ perror("mmap");
+ exit(1);
+ }
+ if (munmap(p, 4096) < 0)
+ {
+ perror("munmap");
+ exit(1);
+ }
+ if ((p =3D mmap((void*)0x1F7F101000, 4096, PROT_READ,
+ MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)) =3D=3D (void *)-1)
+ {
+ perror("mmap");
+ exit(1);
+ }
+ if ((p =3D mmap((void*)0x1F7F101000, 4096, PROT_READ,
+ MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)) =3D=3D (void *)-1)
+ {
+ perror("mmap");
+ exit(1);
+ }
+
+ printf("made it through alive!\n");
+ exit(0);
+}
Added: trunk/none/tests/amd64/nibz_bennee_mmap.stderr.exp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/amd64/nibz_bennee_mmap.stderr.exp =
(rev 0)
+++ trunk/none/tests/amd64/nibz_bennee_mmap.stderr.exp 2006-08-16 01:50:5=
5 UTC (rev 6002)
@@ -0,0 +1,2 @@
+
+
Added: trunk/none/tests/amd64/nibz_bennee_mmap.stdout.exp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/amd64/nibz_bennee_mmap.stdout.exp =
(rev 0)
+++ trunk/none/tests/amd64/nibz_bennee_mmap.stdout.exp 2006-08-16 01:50:5=
5 UTC (rev 6002)
@@ -0,0 +1 @@
+made it through alive!
Added: trunk/none/tests/amd64/nibz_bennee_mmap.vgtest
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/tests/amd64/nibz_bennee_mmap.vgtest =
(rev 0)
+++ trunk/none/tests/amd64/nibz_bennee_mmap.vgtest 2006-08-16 01:50:55 UT=
C (rev 6002)
@@ -0,0 +1 @@
+prog: nibz_bennee_mmap
|