diff -Naur ltp-full-20091231.orig/testcases/kernel/mem/mtest06/mmap1.c ltp-full-20091231/testcases/kernel/mem/mtest06/mmap1.c --- ltp-full-20091231.orig/testcases/kernel/mem/mtest06/mmap1.c 2009-10-13 19:30:46.000000000 +0530 +++ ltp-full-20091231/testcases/kernel/mem/mtest06/mmap1.c 2010-03-15 16:30:33.000000000 +0530 @@ -138,6 +138,7 @@ int verbose_print = FALSE;/* when called with -v print more info */ caddr_t *map_address; /* address of the file mapped. */ sigjmp_buf jmpbuf; /* argument to sigsetjmp and siglongjmp */ +long map_len; char *TCID = "mmap1"; int TST_TOTAL = 1; @@ -168,14 +169,22 @@ _exit(0); case SIGSEGV: - if (info->si_code == SEGV_MAPERR && - info->si_addr == map_address) + if ( info->si_addr == map_address || + (map_address && (info->si_addr >= (void*) map_address && + info->si_addr < (void *)((long)map_address + map_len)) + ) + ) { tst_resm(TINFO, "page fault occurred at %p", map_address); longjmp(jmpbuf, 1); - } + } else { + fprintf(stderr, "caught SIGSEGV at %p while mmap is (%p,%p) - exiting\n", + info->si_addr, map_address, (void*)((long)map_address + map_len)); + _exit(-1); + } + default: fprintf(stderr, "caught unexpected signal - %d --- exiting\n", signal); @@ -293,6 +302,9 @@ (long *)args; long exit_val = 0; /* exit value of the pthread */ + /* The size of the map */ + map_len = mwuargs[1]; + tst_resm(TINFO, "pid[%d]: map, change contents, unmap files %d times", getpid(), (int)mwuargs[2]); if (verbose_print)