From: Subrata Modak <[email protected]> Subject: Re: [LTP] [PATCH] Writev06: Fix Error Checking for mmap() Date: Wed, 18 Mar 2009 14:04:12 +0530
> On Tue, 2009-03-17 at 16:41 +0800, CAI Qian wrote: >> Hi, >> >> Sometimes, writev06 test case failed due to receiving a SIGSEGV signal, >> >> <<<test_start>>> >> tag=writev06 stime=1236859804 >> cmdline="writev06" >> contacts="" >> analysis=exit >> initiation_status="ok" >> <<<test_output>>> >> writev06 1 BROK : Unexpected signal 11 received. >> writev06 2 FAIL : unlink Failed--file = writev_data_file.23185, >> errno = 2 >> incrementing stop >> <<<execution_status>>> >> duration=0 termination_type=exited termination_id=3 corefile=no >> cutime=0 cstime=0 >> <<<test_end>>> >> >> The test gives too little information to figure it out what might be >> wrong. This failure is not always reproducible, and I have seen the >> SIGSEGV has just arrived after a few mmap() calls. The following patch >> makes it easier to debug this type of failure by fixing error checking >> code for mmap() calls. >> >> Signed-off-by: CAI Qian <[email protected]> > > Thanks. Sorry, a little bit late. Can you apply version 2 instead which fix the actual SIGSEGV issue? Thanks, CAI Qian > > Regards-- > Subrata > >> >> --- testcases/kernel/syscalls/writev/writev06.c.orig 2009-03-17 >> 16:10:44.000000000 +0800 >> +++ testcases/kernel/syscalls/writev/writev06.c 2009-03-17 >> 16:26:58.000000000 +0800 >> @@ -193,20 +193,28 @@ >> * mapping around */ >> bad_addr[0] = mmap(NULL, page_size * 3, PROT_NONE, >> MAP_PRIVATE_EXCEPT_UCLINUX|MAP_ANONYMOUS, 0, 0); >> + if (bad_addr[0] == MAP_FAILED) >> + tst_brkm(TBROK, cleanup, "mmap failed for bad_addr[0]"); >> + >> good_addr[0] = mmap(NULL, page_size, PROT_READ|PROT_WRITE, >> MAP_PRIVATE_EXCEPT_UCLINUX|MAP_ANONYMOUS, 0, 0); >> + if (good_addr[0] == MAP_FAILED) >> + tst_brkm(TBROK, cleanup, "mmap failed for good_addr[0]"); >> + >> bad_addr[1] = mmap(NULL, page_size * 3, PROT_NONE, >> MAP_PRIVATE_EXCEPT_UCLINUX|MAP_ANONYMOUS, 0, 0); >> + if (bad_addr[1] == MAP_FAILED) >> + tst_brkm(TBROK, cleanup, "mmap failed for bad_addr[1]"); >> + >> good_addr[1] = mmap(NULL, page_size, PROT_READ|PROT_WRITE, >> MAP_PRIVATE_EXCEPT_UCLINUX|MAP_ANONYMOUS, 0, 0); >> + if (good_addr[1] == MAP_FAILED) >> + tst_brkm(TBROK, cleanup, "mmap failed for good_addr[1]"); >> + >> bad_addr[2] = mmap(NULL, page_size * 3, PROT_NONE, >> MAP_PRIVATE_EXCEPT_UCLINUX|MAP_ANONYMOUS, 0, 0); >> - >> - if (good_addr[0] <= 0 || good_addr[1] <= 0 || >> - bad_addr[0] <= 0 || bad_addr[0] <= 0 || >> - bad_addr[2] <= 0) { >> - printf("mmap failed\n"); >> - } >> + if (bad_addr[2] == MAP_FAILED) >> + tst_brkm(TBROK, cleanup, "mmap failed for bad_addr[2]"); >> >> /* force page fault for writable mappings*/ >> memset(good_addr[0],'a', page_size); >> >> ------------------------------------------------------------------------------ >> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are >> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and >> easily build your RIAs with Flex Builder, the Eclipse(TM)based development >> software that enables intelligent coding and step-through debugging. >> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com >> _______________________________________________ >> Ltp-list mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/ltp-list > ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
