All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [Patch] Fix mtest06 failure: caught unexpected signal - 11 --- exiting
@ 2010-08-18  7:33 renxiu liang
  2010-08-18  8:35 ` Garrett Cooper
  2010-08-26  3:36 ` Garrett Cooper
  0 siblings, 2 replies; 11+ messages in thread
From: renxiu liang @ 2010-08-18  7:33 UTC (permalink / raw)
  To: ltp-list

[-- Attachment #1: Type: text/plain, Size: 1451 bytes --]

Hi,

We met the mtest06 failure several times; this is because in
mtest06/mmap1.c, when handling the signal 11 in sig_handler, it doesn't
cover another two race conditions:
one is si_code equals "SEGV_MAPERR" but si_address does not equal to
map_address; and one is si_code equals to "SEGV_ACCERR"; 

see below error log:

<<<test_start>>>
tag=mtest06 stime=1270902396
cmdline="  mmap1 -x 0.05"
contacts=""
analysis=exit
initiation_status="ok"
<<<test_output>>>
mmap1       0  INFO  :  pid[5456]: map, change contents, unmap files
1000 times
mmap1       0  INFO  :  created thread[1216369840]
mmap1       0  INFO  :  pid[5456] - read contents of memory 0x48002000
1000 times
mmap1       0  INFO  :  page fault occurred at 0x48002000
mmap1       0  INFO  :  page fault occurred at 0x48002000
mmap1       0  INFO  :  page fault occurred at 0x48002000
mmap1       0  INFO  :  page fault occurred at 0x48002000
......
mmap1       0  INFO  :  page fault occurred at 0x48002000
mmap1       0  INFO  :  page fault occurred at 0x48002000
caught unexpected signal - 11 --- exiting
<<<execution_status>>>
duration=1 termination_type=exited termination_id=255 corefile=no
cutime=0 cstime=4
<<<test_end>>>

I made a patch to cover all the three race conditions in one case in
sig_handler(), 
then run mtest06 repeatedly on different archs, test will not fail by
catching signal 11.

See attached patch.

Thanks,
Renxiu

[-- Attachment #2: 0001-Fix-sig_handler-for-SIGSEGV-in-mmap1.c.patch --]
[-- Type: text/x-patch, Size: 1740 bytes --]

From cb3a3032acf818a69e6d7bd028d4b0c927b0fac4 Mon Sep 17 00:00:00 2001
From: Renxiu Liang <renxiu.liang@windriver.com>
Date: Mon, 16 Aug 2010 19:57:54 -0700
Subject: [PATCH 1/1] Fix sig_handler() for SIGSEGV in mmap1.c

"mtest06" is aimed at stressing the memory manager by simultanious
map/unmap/read by light weight processes; it tries to handle
SIGSEGV signal in sig_handler instead of doing synchronizations
between read and write threads; two more race conditions are
not covered: one is si_code equals "SEGV_MAPERR" but si_address
does not equal to map_address; the other is si_code equals to
"SEGV_ACCERR"; try to cover the three conditions in one case
to reduce the complexity.

Signed-off-by: Renxiu Liang <renxiu.liang@windriver.com>
---
 testcases/kernel/mem/mtest06/mmap1.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/testcases/kernel/mem/mtest06/mmap1.c b/testcases/kernel/mem/mtest06/mmap1.c
index 47ab49a..7eb3547 100644
--- a/testcases/kernel/mem/mtest06/mmap1.c
+++ b/testcases/kernel/mem/mtest06/mmap1.c
@@ -168,14 +168,10 @@ sig_handler(int signal,		/* signal number, set to handle SIGALRM       */
              _exit(0);
 
         case SIGSEGV:
-             if (info->si_code == SEGV_MAPERR &&
-                      info->si_addr == map_address)
-             {
-                  tst_resm(TINFO,
+             tst_resm(TINFO,
                     "page fault occurred at %p",
                     map_address);
-                  longjmp(jmpbuf, 1);
-             }
+             longjmp(jmpbuf, 1);
         default:
             fprintf(stderr, "caught unexpected signal - %d --- exiting\n",
                      signal);
-- 
1.6.1


[-- Attachment #3: Type: text/plain, Size: 224 bytes --]

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 11+ messages in thread
* Re: [LTP] [Patch] Fix mtest06 failure: caught unexpected signal - 11 --- exiting
@ 2010-09-06 16:16 Subrata Modak
  0 siblings, 0 replies; 11+ messages in thread
From: Subrata Modak @ 2010-09-06 16:16 UTC (permalink / raw)
  To: suzuki; +Cc: ltp-list

Suzuki,

Can you please review this patch ?

Regards--
Subrata

-------- Forwarded Message --------
From: Garrett Cooper <yanegomi@gmail.com>
To: renxiu liang <renxiu.liang@windriver.com>
Cc: ltp-list@lists.sf.net
Subject: Re: [LTP] [Patch] Fix mtest06 failure: caught unexpected signal
- 11 --- exiting
Date: Wed, 1 Sep 2010 00:26:47 -0700

On Mon, Aug 30, 2010 at 6:51 PM, renxiu liang
<renxiu.liang@windriver.com> wrote:
> On Wed, 2010-08-25 at 20:36 -0700, Garrett Cooper wrote:
>> On Wed, Aug 18, 2010 at 12:33 AM, renxiu liang
>> <renxiu.liang@windriver.com> wrote:
>> > Hi,
>> >
>> > We met the mtest06 failure several times; this is because in
>> > mtest06/mmap1.c, when handling the signal 11 in sig_handler, it doesn't
>> > cover another two race conditions:
>> > one is si_code equals "SEGV_MAPERR" but si_address does not equal to
>> > map_address; and one is si_code equals to "SEGV_ACCERR";
>> >
>> > see below error log:
>> >
>> > <<<test_start>>>
>> > tag=mtest06 stime=1270902396
>> > cmdline="  mmap1 -x 0.05"
>> > contacts=""
>> > analysis=exit
>> > initiation_status="ok"
>> > <<<test_output>>>
>> > mmap1       0  INFO  :  pid[5456]: map, change contents, unmap files
>> > 1000 times
>> > mmap1       0  INFO  :  created thread[1216369840]
>> > mmap1       0  INFO  :  pid[5456] - read contents of memory 0x48002000
>> > 1000 times
>> > mmap1       0  INFO  :  page fault occurred at 0x48002000
>> > mmap1       0  INFO  :  page fault occurred at 0x48002000
>> > mmap1       0  INFO  :  page fault occurred at 0x48002000
>> > mmap1       0  INFO  :  page fault occurred at 0x48002000
>> > ......
>> > mmap1       0  INFO  :  page fault occurred at 0x48002000
>> > mmap1       0  INFO  :  page fault occurred at 0x48002000
>> > caught unexpected signal - 11 --- exiting
>> > <<<execution_status>>>
>> > duration=1 termination_type=exited termination_id=255 corefile=no
>> > cutime=0 cstime=4
>> > <<<test_end>>>
>> >
>> > I made a patch to cover all the three race conditions in one case in
>> > sig_handler(),
>> > then run mtest06 repeatedly on different archs, test will not fail by
>> > catching signal 11.
>>
>> Could you print out what the value of info->si_code and info->si_addr
>> are at the time of the fault? Also, which architecture(s) are you
>> running into this issue on?
> Hi Garrett,
>
> Sorry for the late reply; See attached mtest06 logs, I printed out the
> values of si_code, si_addr, map_address;
> it is reproducible on arm, x86, ppc and mips; though it is not
> reproducible every time, but can be reproducible if run the case
> repeatedly.

Nothing is jumping out at me as being incorrect, so I think it's best
that I bring in a better pair of eyes, just in case.

Suzuki-san,
    Could you please help review this patch?
Thanks!
-Garrett
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list


------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-09-25  3:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <52CF90264091A14888078A031D780F4305936FA4@ism-mail03.corp.ad.wrs.com>
2010-08-17  5:57 ` [LTP] [Patch] Fix mtest06 failure: caught unexpected signal - 11 --- exiting Liang, RenXiu
2010-09-06 16:17   ` Subrata Modak
2010-08-18  7:33 renxiu liang
2010-08-18  8:35 ` Garrett Cooper
2010-08-26  3:36 ` Garrett Cooper
2010-08-31  1:51   ` renxiu liang
2010-09-01  7:26     ` Garrett Cooper
2010-09-01  7:27       ` Garrett Cooper
     [not found]         ` <1284874992.12271.5.camel@PEK-RLIANG-D1>
     [not found]           ` <4C95AF8A.8000803@in.ibm.com>
     [not found]             ` <1284878205.12271.9.camel@PEK-RLIANG-D1>
     [not found]               ` <4C95B7D9.5060801@in.ibm.com>
2010-09-19  7:17                 ` Suzuki Poulose
2010-09-25  3:43                   ` renxiu liang
2010-09-06 16:16 Subrata Modak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.