* [LTP] [PATCH V2] ppoll01: add signal() syscall to register the signal handler
@ 2009-10-01 8:10 Chandru
2009-10-13 12:13 ` Subrata Modak
0 siblings, 1 reply; 8+ messages in thread
From: Chandru @ 2009-10-01 8:10 UTC (permalink / raw)
To: ltp-list; +Cc: vapier
The ppoll01 testcase has a signal handler in it but this signal handler is not registered with the kernel through the signal() syscall. The testcase fails when it sends a SIGINT to itself as part of one of the case of the test run.
The following patch
1. Adds a signal() syscall to register the signal handler
2. Corrects the expected 'revents' for the case where ppoll() is called on a file which is only opened in read/write mode, i.e case00.
Signed-off-by: Chandru S <chandru@linux.vnet.ibm.com>
---
testcases/kernel/syscalls/ppoll/ppoll01.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
--- testcases/kernel/syscalls/ppoll/ppoll01.c.orig 2009-09-29 21:28:55.510487735 +0530
+++ testcases/kernel/syscalls/ppoll/ppoll01.c 2009-10-01 18:27:30.452236128 +0530
@@ -79,6 +79,8 @@ char *TCID = "ppoll01"; /* Test program
int testno;
int TST_TOTAL = 1; /* total number of tests in this file. */
+void sighandler(int sig); /* signals handler function for the test */
+
/* Extern Global Functions */
/******************************************************************************/
/* */
@@ -125,7 +127,8 @@ extern void cleanup() {
/* */
/******************************************************************************/
void setup() {
- /* Capture signals if any */
+ /* Capture signals */
+ signal(SIGINT, &sighandler);
/* Create temporary directories */
TEST_PAUSE;
tst_tmpdir();
@@ -191,7 +194,7 @@ struct test_case {
static struct test_case tcase[] = {
{ // case00
.ttype = NORMAL,
- .expect_revents = POLLOUT,
+ .expect_revents = POLLOUT | POLLIN,
.ret = 0,
.err = 0,
},
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH V2] ppoll01: add signal() syscall to register the signal handler
2009-10-01 8:10 [LTP] [PATCH V2] ppoll01: add signal() syscall to register the signal handler Chandru
@ 2009-10-13 12:13 ` Subrata Modak
2009-10-14 6:41 ` Chandru
0 siblings, 1 reply; 8+ messages in thread
From: Subrata Modak @ 2009-10-13 12:13 UTC (permalink / raw)
To: Chandru; +Cc: ltp-list, vapier
On Thu, 2009-10-01 at 13:40 +0530, Chandru wrote:
> The ppoll01 testcase has a signal handler in it but this signal handler is not registered with the kernel through the signal() syscall. The testcase fails when it sends a SIGINT to itself as part of one of the case of the test run.
> The following patch
> 1. Adds a signal() syscall to register the signal handler
> 2. Corrects the expected 'revents' for the case where ppoll() is called on a file which is only opened in read/write mode, i.e case00.
>
> Signed-off-by: Chandru S <chandru@linux.vnet.ibm.com>
Hi Chandru,
Can you please resend this with a diff from the Latest CVS snapshot ?
patching file testcases/kernel/syscalls/ppoll/ppoll01.c
Hunk #3 FAILED at 194.
1 out of 3 hunks FAILED -- saving rejects to file
testcases/kernel/syscalls/ppoll/ppoll01.c.rej
Regards--
Subrata
> ---
> testcases/kernel/syscalls/ppoll/ppoll01.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> --- testcases/kernel/syscalls/ppoll/ppoll01.c.orig 2009-09-29 21:28:55.510487735 +0530
> +++ testcases/kernel/syscalls/ppoll/ppoll01.c 2009-10-01 18:27:30.452236128 +0530
> @@ -79,6 +79,8 @@ char *TCID = "ppoll01"; /* Test program
> int testno;
> int TST_TOTAL = 1; /* total number of tests in this file. */
>
> +void sighandler(int sig); /* signals handler function for the test */
> +
> /* Extern Global Functions */
> /******************************************************************************/
> /* */
> @@ -125,7 +127,8 @@ extern void cleanup() {
> /* */
> /******************************************************************************/
> void setup() {
> - /* Capture signals if any */
> + /* Capture signals */
> + signal(SIGINT, &sighandler);
> /* Create temporary directories */
> TEST_PAUSE;
> tst_tmpdir();
> @@ -191,7 +194,7 @@ struct test_case {
> static struct test_case tcase[] = {
> { // case00
> .ttype = NORMAL,
> - .expect_revents = POLLOUT,
> + .expect_revents = POLLOUT | POLLIN,
> .ret = 0,
> .err = 0,
> },
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9-12, 2009. Register now!
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH V2] ppoll01: add signal() syscall to register the signal handler
2009-10-13 12:13 ` Subrata Modak
@ 2009-10-14 6:41 ` Chandru
2009-10-14 20:28 ` Subrata Modak
0 siblings, 1 reply; 8+ messages in thread
From: Chandru @ 2009-10-14 6:41 UTC (permalink / raw)
To: subrata; +Cc: ltp-list, vapier
On Tuesday 13 October 2009 17:43:37 Subrata Modak wrote:
> On Thu, 2009-10-01 at 13:40 +0530, Chandru wrote:
> > The ppoll01 testcase has a signal handler in it but this signal handler is not registered with the kernel through the signal() syscall. The testcase fails when it sends a SIGINT to itself as part of one of the case of the test run.
> > The following patch
> > 1. Adds a signal() syscall to register the signal handler
> > 2. Corrects the expected 'revents' for the case where ppoll() is called on a file which is only opened in read/write mode, i.e case00.
> >
> > Signed-off-by: Chandru S <chandru@linux.vnet.ibm.com>
>
> Hi Chandru,
>
> Can you please resend this with a diff from the Latest CVS snapshot ?
>
Hi Subrata,
Thanks for letting me know. Here is the patch taken from the latest snapshot.
The following patch adds a signal() syscall to the ppoll01 testcase. The testcase has a signal handler in it but this signal handler is not registered with the kernel through the signal() syscall. Without the patch the testcase fails when it sends a SIGINT to itself as part of one of the case of the test run.
Signed-off-by: Chandru S <chandru@linux.vnet.ibm.com>
---
--- ltp/testcases/kernel/syscalls/ppoll/ppoll01.c.orig 2009-10-14 16:58:45.547235527 +0530
+++ ltp/testcases/kernel/syscalls/ppoll/ppoll01.c 2009-10-14 16:53:42.828486675 +0530
@@ -106,6 +106,8 @@ extern void cleanup() {
tst_exit();
}
+void sighandler(int sig); /* signals handler function for the test */
+
/* Local Functions */
/******************************************************************************/
/* */
@@ -126,6 +128,8 @@ extern void cleanup() {
/******************************************************************************/
void setup() {
/* Capture signals if any */
+ signal(SIGINT, &sighandler);
+
/* Create temporary directories */
TEST_PAUSE;
tst_tmpdir();
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH V2] ppoll01: add signal() syscall to register the signal handler
2009-10-14 6:41 ` Chandru
@ 2009-10-14 20:28 ` Subrata Modak
2009-10-15 1:25 ` Garrett Cooper
0 siblings, 1 reply; 8+ messages in thread
From: Subrata Modak @ 2009-10-14 20:28 UTC (permalink / raw)
To: Chandru; +Cc: ltp-list, vapier
On Wed, 2009-10-14 at 12:11 +0530, Chandru wrote:
> On Tuesday 13 October 2009 17:43:37 Subrata Modak wrote:
> > On Thu, 2009-10-01 at 13:40 +0530, Chandru wrote:
> > > The ppoll01 testcase has a signal handler in it but this signal handler is not registered with the kernel through the signal() syscall. The testcase fails when it sends a SIGINT to itself as part of one of the case of the test run.
> > > The following patch
> > > 1. Adds a signal() syscall to register the signal handler
> > > 2. Corrects the expected 'revents' for the case where ppoll() is called on a file which is only opened in read/write mode, i.e case00.
> > >
> > > Signed-off-by: Chandru S <chandru@linux.vnet.ibm.com>
> >
> > Hi Chandru,
> >
> > Can you please resend this with a diff from the Latest CVS snapshot ?
> >
>
> Hi Subrata,
>
> Thanks for letting me know. Here is the patch taken from the latest snapshot.
>
> The following patch adds a signal() syscall to the ppoll01 testcase. The testcase has a signal handler in it but this signal handler is not registered with the kernel through the signal() syscall. Without the patch the testcase fails when it sends a SIGINT to itself as part of one of the case of the test run.
>
> Signed-off-by: Chandru S <chandru@linux.vnet.ibm.com>
Thanks.
Regards--
Subrata
> ---
>
> --- ltp/testcases/kernel/syscalls/ppoll/ppoll01.c.orig 2009-10-14 16:58:45.547235527 +0530
> +++ ltp/testcases/kernel/syscalls/ppoll/ppoll01.c 2009-10-14 16:53:42.828486675 +0530
> @@ -106,6 +106,8 @@ extern void cleanup() {
> tst_exit();
> }
>
> +void sighandler(int sig); /* signals handler function for the test */
> +
> /* Local Functions */
> /******************************************************************************/
> /* */
> @@ -126,6 +128,8 @@ extern void cleanup() {
> /******************************************************************************/
> void setup() {
> /* Capture signals if any */
> + signal(SIGINT, &sighandler);
> +
> /* Create temporary directories */
> TEST_PAUSE;
> tst_tmpdir();
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH V2] ppoll01: add signal() syscall to register the signal handler
2009-10-14 20:28 ` Subrata Modak
@ 2009-10-15 1:25 ` Garrett Cooper
2009-10-15 8:44 ` Chandru
0 siblings, 1 reply; 8+ messages in thread
From: Garrett Cooper @ 2009-10-15 1:25 UTC (permalink / raw)
To: subrata; +Cc: ltp-list, vapier
On Wed, Oct 14, 2009 at 1:28 PM, Subrata Modak
<subrata@linux.vnet.ibm.com> wrote:
> On Wed, 2009-10-14 at 12:11 +0530, Chandru wrote:
>> On Tuesday 13 October 2009 17:43:37 Subrata Modak wrote:
>> > On Thu, 2009-10-01 at 13:40 +0530, Chandru wrote:
>> > > The ppoll01 testcase has a signal handler in it but this signal handler is not registered with the kernel through the signal() syscall. The testcase fails when it sends a SIGINT to itself as part of one of the case of the test run.
>> > > The following patch
>> > > 1. Adds a signal() syscall to register the signal handler
>> > > 2. Corrects the expected 'revents' for the case where ppoll() is called on a file which is only opened in read/write mode, i.e case00.
>> > >
>> > > Signed-off-by: Chandru S <chandru@linux.vnet.ibm.com>
>> >
>> > Hi Chandru,
>> >
>> > Can you please resend this with a diff from the Latest CVS snapshot ?
>> >
>>
>> Hi Subrata,
>>
>> Thanks for letting me know. Here is the patch taken from the latest snapshot.
>>
>> The following patch adds a signal() syscall to the ppoll01 testcase. The testcase has a signal handler in it but this signal handler is not registered with the kernel through the signal() syscall. Without the patch the testcase fails when it sends a SIGINT to itself as part of one of the case of the test run.
>>
>> Signed-off-by: Chandru S <chandru@linux.vnet.ibm.com>
>
> Thanks.
>
> Regards--
> Subrata
>
>> ---
>>
>> --- ltp/testcases/kernel/syscalls/ppoll/ppoll01.c.orig 2009-10-14 16:58:45.547235527 +0530
>> +++ ltp/testcases/kernel/syscalls/ppoll/ppoll01.c 2009-10-14 16:53:42.828486675 +0530
>> @@ -106,6 +106,8 @@ extern void cleanup() {
>> tst_exit();
>> }
>>
>> +void sighandler(int sig); /* signals handler function for the test */
>> +
>> /* Local Functions */
>> /******************************************************************************/
>> /* */
>> @@ -126,6 +128,8 @@ extern void cleanup() {
>> /******************************************************************************/
>> void setup() {
>> /* Capture signals if any */
>> + signal(SIGINT, &sighandler);
>> +
>> /* Create temporary directories */
>> TEST_PAUSE;
>> tst_tmpdir();
Just curious -- was the issue seen at the following point in the code
previously?
361 TEST(sys_ret = syscall(__NR_ppoll, p_fds, nfds, p_ts,
p_sigmask, sigsetsize)); /* <-- Blocks here indefinitely */
362 sys_errno = errno;
363 if (sys_ret <= 0 || tc->ret < 0)
364 goto TEST_END;
365
366 cmp_ok = fds[0].revents == tc->expect_revents;
I've seen this issue 1 out of the 8 or 9 times I've run this test.
Thanks!
-Garrett
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH V2] ppoll01: add signal() syscall to register the signal handler
2009-10-15 1:25 ` Garrett Cooper
@ 2009-10-15 8:44 ` Chandru
2009-10-15 12:43 ` Garrett Cooper
0 siblings, 1 reply; 8+ messages in thread
From: Chandru @ 2009-10-15 8:44 UTC (permalink / raw)
To: Garrett Cooper; +Cc: vapier, ltp-list
On Thursday 15 October 2009 06:55:29 Garrett Cooper wrote:
> Just curious -- was the issue seen at the following point in the code
> previously?
>
> 361 TEST(sys_ret = syscall(__NR_ppoll, p_fds, nfds, p_ts,
> p_sigmask, sigsetsize)); /* <-- Blocks here indefinitely */
> 362 sys_errno = errno;
> 363 if (sys_ret <= 0 || tc->ret < 0)
> 364 goto TEST_END;
> 365
> 366 cmp_ok = fds[0].revents == tc->expect_revents;
>
> I've seen this issue 1 out of the 8 or 9 times I've run this test.
Nope, without the patch we only see case00 completing and the test exits while in the middle of case01
# ./ppoll01
ppoll01 0 TINFO : (case00) START
EXPECT: return value(ret)=(N >= 0) errno=0 (Success)
RESULT: return value(ret)= 1 errno=0 (Success)
ppoll01 0 TINFO : (case00) END => OK
ppoll01 0 TINFO : (case01) START
#
With the patch we see the output as follows...
# ./ppoll01
ppoll01 0 TINFO : (case00) START
EXPECT: return value(ret)=(N >= 0) errno=0 (Success)
RESULT: return value(ret)= 1 errno=0 (Success)
ppoll01 0 TINFO : (case00) END => OK
ppoll01 0 TINFO : (case01) START
EXPECT: return value(ret)=(N >= 0) errno=0 (Success)
RESULT: return value(ret)= 0 errno=0 (Success)
ppoll01 0 TINFO : (case01) END => OK
ppoll01 0 TINFO : (case02) START
EXPECT: return value(ret)=(N >= 0) errno=0 (Success)
RESULT: return value(ret)= 0 errno=0 (Success)
ppoll01 0 TINFO : (case02) END => OK
ppoll01 0 TINFO : (case03) START
EXPECT: return value(ret)=(N >= 0) errno=0 (Success)
RESULT: return value(ret)= 1 errno=0 (Success)
ppoll01 0 TINFO : (case03) END => OK
ppoll01 0 TINFO : (case04) START
EXPECT: return value(ret)=-1 errno=4 (Interrupted system call)
RESULT: return value(ret)=-1 errno=4 (Interrupted system call)
ppoll01 0 TINFO : (case04) END => OK
ppoll01 0 TINFO : (case05) START
EXPECT: return value(ret)=-1 errno=4 (Interrupted system call)
RESULT: return value(ret)=-1 errno=4 (Interrupted system call)
ppoll01 0 TINFO : (case05) END => OK
ppoll01 0 TINFO : (case06) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
ppoll01 0 TINFO : (case06) END => OK
ppoll01 0 TINFO : (case07) START
EXPECT: return value(ret)=-1 errno=14 (Bad address)
RESULT: return value(ret)=-1 errno=14 (Bad address)
ppoll01 0 TINFO : (case07) END => OK
ppoll01 1 TPASS : ppoll01 call succeeded
#
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH V2] ppoll01: add signal() syscall to register the signal handler
2009-10-15 8:44 ` Chandru
@ 2009-10-15 12:43 ` Garrett Cooper
2009-10-15 12:45 ` Garrett Cooper
0 siblings, 1 reply; 8+ messages in thread
From: Garrett Cooper @ 2009-10-15 12:43 UTC (permalink / raw)
To: Chandru; +Cc: vapier, ltp-list
On Thu, Oct 15, 2009 at 1:44 AM, Chandru <chandru@in.ibm.com> wrote:
> On Thursday 15 October 2009 06:55:29 Garrett Cooper wrote:
>> Just curious -- was the issue seen at the following point in the code
>> previously?
>>
>> 361 TEST(sys_ret = syscall(__NR_ppoll, p_fds, nfds, p_ts,
>> p_sigmask, sigsetsize)); /* <-- Blocks here indefinitely */
>> 362 sys_errno = errno;
>> 363 if (sys_ret <= 0 || tc->ret < 0)
>> 364 goto TEST_END;
>> 365
>> 366 cmp_ok = fds[0].revents == tc->expect_revents;
>>
>> I've seen this issue 1 out of the 8 or 9 times I've run this test.
>
> Nope, without the patch we only see case00 completing and the test exits while in the middle of case01
>
> # ./ppoll01
> ppoll01 0 TINFO : (case00) START
> EXPECT: return value(ret)=(N >= 0) errno=0 (Success)
> RESULT: return value(ret)= 1 errno=0 (Success)
> ppoll01 0 TINFO : (case00) END => OK
> ppoll01 0 TINFO : (case01) START
> #
>
>
> With the patch we see the output as follows...
>
> # ./ppoll01
> ppoll01 0 TINFO : (case00) START
> EXPECT: return value(ret)=(N >= 0) errno=0 (Success)
> RESULT: return value(ret)= 1 errno=0 (Success)
> ppoll01 0 TINFO : (case00) END => OK
> ppoll01 0 TINFO : (case01) START
> EXPECT: return value(ret)=(N >= 0) errno=0 (Success)
> RESULT: return value(ret)= 0 errno=0 (Success)
> ppoll01 0 TINFO : (case01) END => OK
> ppoll01 0 TINFO : (case02) START
> EXPECT: return value(ret)=(N >= 0) errno=0 (Success)
> RESULT: return value(ret)= 0 errno=0 (Success)
> ppoll01 0 TINFO : (case02) END => OK
> ppoll01 0 TINFO : (case03) START
> EXPECT: return value(ret)=(N >= 0) errno=0 (Success)
> RESULT: return value(ret)= 1 errno=0 (Success)
> ppoll01 0 TINFO : (case03) END => OK
> ppoll01 0 TINFO : (case04) START
> EXPECT: return value(ret)=-1 errno=4 (Interrupted system call)
> RESULT: return value(ret)=-1 errno=4 (Interrupted system call)
> ppoll01 0 TINFO : (case04) END => OK
> ppoll01 0 TINFO : (case05) START
> EXPECT: return value(ret)=-1 errno=4 (Interrupted system call)
> RESULT: return value(ret)=-1 errno=4 (Interrupted system call)
> ppoll01 0 TINFO : (case05) END => OK
> ppoll01 0 TINFO : (case06) START
> EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
> RESULT: return value(ret)=-1 errno=22 (Invalid argument)
> ppoll01 0 TINFO : (case06) END => OK
> ppoll01 0 TINFO : (case07) START
> EXPECT: return value(ret)=-1 errno=14 (Bad address)
> RESULT: return value(ret)=-1 errno=14 (Bad address)
> ppoll01 0 TINFO : (case07) END => OK
> ppoll01 1 TPASS : ppoll01 call succeeded
Interesting. The cause may be the same, but the effect may be
different, as this is blocking with this section of the test:
case MINUS_NSEC:
ts.tv_sec = 0;
ts.tv_nsec = -1;
p_ts = &ts;
break;
Which is fine, but depending on whether or not a previous testcase
fails with EOK and a return code of 0. Example:
#define _GNU_SOURCE
#include <signal.h>
#include <poll.h>
#include <errno.h>
#include <string.h>
int main (void) {
struct pollfd fds;
struct timespec timeout;
sigset_t sigmask;
sigemptyset(&sigmask);
timeout.tv_sec = 0;
timeout.tv_nsec = 5e8; /* .5 sec */
if (ppoll(&fds, 1, &timeout, &sigmask) <= 0) {
perror("ppoll");
return 0;
}
return 1;
}
gcooper@orangebox ~ $ ./ppoll_test
ppoll: Success
The manpage doesn't say that it shouldn't set errno to ETIME, etc,
so this is a legitimate return value (despite the fact that the
testcase fails claiming that the subtestcase failed and the call
succeeded, IIRC -- or maybe it was another test...).
I'll definitely keep my eyes peeled for this particular issue
though in the future.
Thanks!
-Garrett
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH V2] ppoll01: add signal() syscall to register the signal handler
2009-10-15 12:43 ` Garrett Cooper
@ 2009-10-15 12:45 ` Garrett Cooper
0 siblings, 0 replies; 8+ messages in thread
From: Garrett Cooper @ 2009-10-15 12:45 UTC (permalink / raw)
To: Chandru; +Cc: vapier, ltp-list
On Thu, Oct 15, 2009 at 5:43 AM, Garrett Cooper <yanegomi@gmail.com> wrote:
> On Thu, Oct 15, 2009 at 1:44 AM, Chandru <chandru@in.ibm.com> wrote:
>> On Thursday 15 October 2009 06:55:29 Garrett Cooper wrote:
>>> Just curious -- was the issue seen at the following point in the code
>>> previously?
>>>
>>> 361 TEST(sys_ret = syscall(__NR_ppoll, p_fds, nfds, p_ts,
>>> p_sigmask, sigsetsize)); /* <-- Blocks here indefinitely */
>>> 362 sys_errno = errno;
>>> 363 if (sys_ret <= 0 || tc->ret < 0)
>>> 364 goto TEST_END;
>>> 365
>>> 366 cmp_ok = fds[0].revents == tc->expect_revents;
>>>
>>> I've seen this issue 1 out of the 8 or 9 times I've run this test.
>>
>> Nope, without the patch we only see case00 completing and the test exits while in the middle of case01
>>
>> # ./ppoll01
>> ppoll01 0 TINFO : (case00) START
>> EXPECT: return value(ret)=(N >= 0) errno=0 (Success)
>> RESULT: return value(ret)= 1 errno=0 (Success)
>> ppoll01 0 TINFO : (case00) END => OK
>> ppoll01 0 TINFO : (case01) START
>> #
>>
>>
>> With the patch we see the output as follows...
>>
>> # ./ppoll01
>> ppoll01 0 TINFO : (case00) START
>> EXPECT: return value(ret)=(N >= 0) errno=0 (Success)
>> RESULT: return value(ret)= 1 errno=0 (Success)
>> ppoll01 0 TINFO : (case00) END => OK
>> ppoll01 0 TINFO : (case01) START
>> EXPECT: return value(ret)=(N >= 0) errno=0 (Success)
>> RESULT: return value(ret)= 0 errno=0 (Success)
>> ppoll01 0 TINFO : (case01) END => OK
>> ppoll01 0 TINFO : (case02) START
>> EXPECT: return value(ret)=(N >= 0) errno=0 (Success)
>> RESULT: return value(ret)= 0 errno=0 (Success)
>> ppoll01 0 TINFO : (case02) END => OK
>> ppoll01 0 TINFO : (case03) START
>> EXPECT: return value(ret)=(N >= 0) errno=0 (Success)
>> RESULT: return value(ret)= 1 errno=0 (Success)
>> ppoll01 0 TINFO : (case03) END => OK
>> ppoll01 0 TINFO : (case04) START
>> EXPECT: return value(ret)=-1 errno=4 (Interrupted system call)
>> RESULT: return value(ret)=-1 errno=4 (Interrupted system call)
>> ppoll01 0 TINFO : (case04) END => OK
>> ppoll01 0 TINFO : (case05) START
>> EXPECT: return value(ret)=-1 errno=4 (Interrupted system call)
>> RESULT: return value(ret)=-1 errno=4 (Interrupted system call)
>> ppoll01 0 TINFO : (case05) END => OK
>> ppoll01 0 TINFO : (case06) START
>> EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
>> RESULT: return value(ret)=-1 errno=22 (Invalid argument)
>> ppoll01 0 TINFO : (case06) END => OK
>> ppoll01 0 TINFO : (case07) START
>> EXPECT: return value(ret)=-1 errno=14 (Bad address)
>> RESULT: return value(ret)=-1 errno=14 (Bad address)
>> ppoll01 0 TINFO : (case07) END => OK
>> ppoll01 1 TPASS : ppoll01 call succeeded
>
> Interesting. The cause may be the same, but the effect may be
> different, as this is blocking with this section of the test:
>
> case MINUS_NSEC:
> ts.tv_sec = 0;
> ts.tv_nsec = -1;
> p_ts = &ts;
> break;
>
> Which is fine, but depending on whether or not a previous testcase
> fails with EOK and a return code of 0. Example:
Sorry -- incomplete thought.
Depending on whether or not it fails with a return code of 0 -- it may
be in our best interest to retry a finite number of times, then give
up and cordon off that testcase so that it can't run and thus block
indefinitely.
> #define _GNU_SOURCE
> #include <signal.h>
> #include <poll.h>
> #include <errno.h>
> #include <string.h>
>
> int main (void) {
>
> struct pollfd fds;
> struct timespec timeout;
> sigset_t sigmask;
>
> sigemptyset(&sigmask);
>
> timeout.tv_sec = 0;
> timeout.tv_nsec = 5e8; /* .5 sec */
>
> if (ppoll(&fds, 1, &timeout, &sigmask) <= 0) {
> perror("ppoll");
> return 0;
> }
> return 1;
> }
>
> gcooper@orangebox ~ $ ./ppoll_test
> ppoll: Success
>
> The manpage doesn't say that it shouldn't set errno to ETIME, etc,
> so this is a legitimate return value (despite the fact that the
> testcase fails claiming that the subtestcase failed and the call
> succeeded, IIRC -- or maybe it was another test...).
> I'll definitely keep my eyes peeled for this particular issue
> though in the future.
Thanks,
-Garrett
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-10-15 12:45 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-01 8:10 [LTP] [PATCH V2] ppoll01: add signal() syscall to register the signal handler Chandru
2009-10-13 12:13 ` Subrata Modak
2009-10-14 6:41 ` Chandru
2009-10-14 20:28 ` Subrata Modak
2009-10-15 1:25 ` Garrett Cooper
2009-10-15 8:44 ` Chandru
2009-10-15 12:43 ` Garrett Cooper
2009-10-15 12:45 ` Garrett Cooper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox