linux-user/mmap v3: Testsuite + bugfixes
PATCH 1/1 linux-user/mmap v3: Testsuite + bugfixes
Hi,
This is the third version of the linux-user/mmap bugfix patches:
* Let the native mmap choose addresses for unfixed mappings.
* For file mappings, correct mapping of pages beyond EOF.
* Adds a small testsuite for linux-user/mmap.
Tested with test-mmap for CRIS, MIPS, ARM and i386, simulated on linux-i686
hosts.
Felipe, I think the problems you are seeing are related to large mmaps failing. By letting the native mmap choose the addresses for unfixed mmaps, I hope your segfaults will go away.
Thanks
Signature · 2 lines
Edgar E. Iglesias Axis Communications AB
configure +1 -0
@@ -1244,6 +1244,7 @@ if test "$source_path_used" = "yes" ; then DIRS="tests tests/cris slirp audio" FILES="Makefile tests/Makefile" FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit" + FILES="$FILES tests/test-mmap.c" for dir in $DIRS ; do mkdir -p $dir done
linux-user/mmap.c +71 -69
179 lines not on this page · raw message
tests/Makefile +9 -0
@@ -51,6 +51,15 @@ ifeq ($(ARCH),i386) @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK (no code copy)"; fi endif +.PHONY: test-mmap +test-mmap: test-mmap.c + $(CC) $(CFLAGS) -Wall -static -O2 $(LDFLAGS) -o $@ $< + -./test-mmap + $(QEMU) ./test-mmap + $(QEMU) -p 8192 ./test-mmap 8192 + $(QEMU) -p 16384 ./test-mmap 16384 + $(QEMU) -p 32768 ./test-mmap 32768 + # generic Linux and CPU test linux-test: linux-test.c $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lm
tests/test-mmap.c new file +449 -0
449 lines not on this page · raw message
Quoted 4 lines · Edgar E. Iglesias
Hi,
This is the third version of the linux-user/mmap bugfix patches:
Quoted 8 lines
* Let the native mmap choose addresses for unfixed mappings.
* For file mappings, correct mapping of pages beyond EOF.
* Adds a small testsuite for linux-user/mmap.Tested with test-mmap for CRIS, MIPS, ARM and i386, simulated on linux-i686
hosts.Felipe, I think the problems you are seeing are related to large mmaps failing. By letting the native mmap choose the addresses for unfixed mmaps, I hope your segfaults will go away.
This patch does fix the weird issues I was having.
Does the test checks for the issues I had?
Signature · 1 line
Felipe Contreras
Quoted 10 lines · Felipe Contreras
Quoted 8 lines · Edgar E. Iglesias
Hi,
This is the third version of the linux-user/mmap bugfix patches:
* Let the native mmap choose addresses for unfixed mappings.
* For file mappings, correct mapping of pages beyond EOF.
* Adds a small testsuite for linux-user/mmap.
Quoted 8 lines
Quoted 4 lines
Tested with test-mmap for CRIS, MIPS, ARM and i386, simulated on linux-i686
hosts.Felipe, I think the problems you are seeing are related to large mmaps failing. By letting the native mmap choose the addresses for unfixed mmaps, I hope your segfaults will go away.
This patch does fix the weird issues I was having.
Does the test checks for the issues I had?
Hello Felipe,
Sorry for the delays. No, the checks won't find regressions with this particular issue. I'll try to write something when I get a chance.
Thanks for all the help debugging this.
Best regards
Signature · 2 lines
Edgar E. Iglesias Axis Communications AB