[#7335] [ltp] ltp test case mmap10 in ltp-full-20120903 fails
Submitted By: Vivi Li
Open Date
2012-09-17 06:03:21 Close Date
2012-09-20 03:39:04
Priority:
Medium Assignee:
Nobody
Status:
Closed Fixed In Release:
N/A
Found In Release:
N/A Release:
Category:
N/A Board:
N/A
Processor:
ALL Silicon Revision:
Is this bug repeatable?:
Yes Resolution:
Rejected
Uboot version or rev.:
Toolchain version or rev.:
gcc4.3-2012_Sep_11
App binary format:
N/A
Summary: [ltp] ltp test case mmap10 in ltp-full-20120903 fails
Details:
ltp test case mmap10 in ltp-full-20120903 fails after apply bellow patch.
--
root:/> mmap10
mmap10 0 TINFO : use /dev/zero.
mmap10 0 TINFO : start tests.
mmap10 1 TFAIL : munmap: errno=EINVAL(22): Invalid argument
mmap10 2 TFAIL : subsequent munmap #1: errno=EINVAL(22): Invalid argument
mmap10 3 TFAIL : subsequent munmap #2: errno=EINVAL(22): Invalid argument
mmap10 4 TFAIL : child exit status is 1
mmap10 5 TFAIL : child exit status is 1
mmap10 6 TFAIL : child exit status is 1
root:/>
--
Bellow is the patch:
--
Index: testcases/kernel/syscalls/mmap/mmap10.c
===================================================================
--- testcases/kernel/syscalls/mmap/mmap10.c (revision 220)
+++ testcases/kernel/syscalls/mmap/mmap10.c (working copy)
@@ -135,42 +135,57 @@
}
if (x == MAP_FAILED)
tst_brkm(TFAIL|TERRNO, cleanup, "mmap");
+
+#ifndef UCLINUX
#ifdef HAVE_MADV_MERGEABLE
if (opt_ksm) {
if (madvise(x, SIZE+SIZE-ps, MADV_MERGEABLE) == -1)
tst_brkm(TBROK|TERRNO, cleanup, "madvise");
}
#endif
+#endif
x[SIZE] = 0;
- switch(n = fork()) {
+ switch(n = FORK_OR_VFORK()) {
case -1:
tst_brkm(TBROK|TERRNO, cleanup, "fork");
case 0:
if (munmap(x+SIZE+ps, SIZE-ps-ps) == -1)
tst_brkm(TFAIL|TERRNO, cleanup, "munmap");
+#ifdef UCLINUX
+ _exit(0);
+#else
exit(0);
+#endif
default:
break;
}
- switch(n = fork()) {
+ switch(n = FORK_OR_VFORK()) {
case -1:
tst_brkm(TBROK|TERRNO, cleanup, "fork");
case 0:
if (munmap(x+SIZE+ps, SIZE-ps-ps) == -1)
tst_brkm(TFAIL|TERRNO, cleanup,
"subsequent munmap #1");
+#ifdef UCLINUX
+ _exit(0);
+#else
exit(0);
+#endif
default:
- switch (n = fork()) {
+ switch (n = FORK_OR_VFORK()) {
case -1:
tst_brkm(TBROK|TERRNO, cleanup, "fork");
case 0:
if (munmap(x+SIZE+ps, SIZE-ps-ps) == -1)
tst_brkm(TFAIL|TERRNO, cleanup,
"subsequent munmap #2");
+#ifdef UCLINUX
+ _exit(0);
+#else
exit(0);
+#endif
default:
break;
}
--
Follow-ups
--- Bob Liu 2012-09-19 02:53:24
nommu doesn't suuport this.
mmap(/dev/zero) return a address, munmap(address+offset) will cause check in
nommu.c fail
1687 if (vma->vm_file) {
1688 do {
1689 if (start > vma->vm_start) {
1690 kleave(" = -EINVAL [miss]");
1693 return -EINVAL;
--- Vivi Li 2012-09-20 04:40:03
OK, disable mmap10 test case and need to push to upstream.
Close it.
Files
Changes
Commits
Dependencies
Duplicates
Associations
Tags
File Name File Type File Size Posted By
No Files Were Found