* [LTP] [PATCH] recvmsg01: kill child only if one was forked
@ 2011-11-07 12:53 Jan Stancek
2011-11-08 3:07 ` Wanlong Gao
2011-11-16 14:24 ` Cyril Hrubis
0 siblings, 2 replies; 7+ messages in thread
From: Jan Stancek @ 2011-11-07 12:53 UTC (permalink / raw)
To: ltp-list
[-- Attachment #1: Type: text/plain, Size: 386 bytes --]
If start_server() fails, then pid will end up with -1 and
cleanup() will do kill(-1, SIGKILL), which kills everything
this process can kill.
Change the test to kill pid (child) only when it successfully
creates one.
Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
testcases/kernel/syscalls/recvmsg/recvmsg01.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
[-- Attachment #2: 0001-recvmsg01-kill-child-only-if-one-was-forked.patch --]
[-- Type: text/x-patch, Size: 632 bytes --]
diff --git a/testcases/kernel/syscalls/recvmsg/recvmsg01.c b/testcases/kernel/syscalls/recvmsg/recvmsg01.c
index ba3b0fd..41d0726 100644
--- a/testcases/kernel/syscalls/recvmsg/recvmsg01.c
+++ b/testcases/kernel/syscalls/recvmsg/recvmsg01.c
@@ -281,7 +281,8 @@ void setup(void)
void cleanup(void)
{
- (void)kill(pid, SIGKILL); /* kill server */
+ if (pid > 0)
+ (void)kill(pid, SIGKILL); /* kill server */
if (tmpsunpath[0] != '\0')
(void)unlink(tmpsunpath);
TEST_CLEANUP;
@@ -528,4 +529,4 @@ void sender(int fd)
(void)sendmsg(fd, &mh, 0);
(void)close(tfd);
(void)unlink(tmpfn);
-}
\ No newline at end of file
+}
[-- Attachment #3: Type: text/plain, Size: 169 bytes --]
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
[-- 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] 7+ messages in thread
* Re: [LTP] [PATCH] recvmsg01: kill child only if one was forked
2011-11-07 12:53 [LTP] [PATCH] recvmsg01: kill child only if one was forked Jan Stancek
@ 2011-11-08 3:07 ` Wanlong Gao
2011-11-08 7:14 ` Jan Stancek
2011-11-16 14:24 ` Cyril Hrubis
1 sibling, 1 reply; 7+ messages in thread
From: Wanlong Gao @ 2011-11-08 3:07 UTC (permalink / raw)
To: Jan Stancek; +Cc: ltp-list
On 11/07/2011 08:53 PM, Jan Stancek wrote:
>
> If start_server() fails, then pid will end up with -1 and
> cleanup() will do kill(-1, SIGKILL), which kills everything
> this process can kill.
>
> Change the test to kill pid (child) only when it successfully
> creates one.
>
Yeah, but this can't fix the problem in this case?
recvmsg01 1 TBROK : server bind failed: errno=???(98): Address already in use
recvmsg01 2 TBROK : Remaining cases broken
Thanks
-Wanlong Gao
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> ---
> testcases/kernel/syscalls/recvmsg/recvmsg01.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
>
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [LTP] [PATCH] recvmsg01: kill child only if one was forked
2011-11-08 3:07 ` Wanlong Gao
@ 2011-11-08 7:14 ` Jan Stancek
2011-11-08 7:21 ` Wanlong Gao
0 siblings, 1 reply; 7+ messages in thread
From: Jan Stancek @ 2011-11-08 7:14 UTC (permalink / raw)
To: gaowanlong; +Cc: ltp-list
----- Original Message -----
> From: "Wanlong Gao" <gaowanlong@cn.fujitsu.com>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: ltp-list@lists.sourceforge.net
> Sent: Tuesday, November 8, 2011 4:07:56 AM
> Subject: Re: [LTP] [PATCH] recvmsg01: kill child only if one was forked
>
> On 11/07/2011 08:53 PM, Jan Stancek wrote:
>
> >
> > If start_server() fails, then pid will end up with -1 and
> > cleanup() will do kill(-1, SIGKILL), which kills everything
> > this process can kill.
> >
> > Change the test to kill pid (child) only when it successfully
> > creates one.
> >
>
>
> Yeah, but this can't fix the problem in this case?
>
> recvmsg01 1 TBROK : server bind failed: errno=???(98): Address
> already in use
> recvmsg01 2 TBROK : Remaining cases broken
>
I'm not sure I follow you here.
In case you described start_server() returns -1,
so pid = -1, and cleanup won't do kill(-1, SIGKILL).
Regards,
Jan
>
> Thanks
> -Wanlong Gao
>
> > Signed-off-by: Jan Stancek <jstancek@redhat.com>
> > ---
> > testcases/kernel/syscalls/recvmsg/recvmsg01.c | 5 +++--
> > 1 files changed, 3 insertions(+), 2 deletions(-)
> >
> >
>
>
>
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [LTP] [PATCH] recvmsg01: kill child only if one was forked
2011-11-08 7:14 ` Jan Stancek
@ 2011-11-08 7:21 ` Wanlong Gao
2011-11-08 7:50 ` Jan Stancek
0 siblings, 1 reply; 7+ messages in thread
From: Wanlong Gao @ 2011-11-08 7:21 UTC (permalink / raw)
To: Jan Stancek; +Cc: ltp-list
On 11/08/2011 03:14 PM, Jan Stancek wrote:
>
>
> ----- Original Message -----
>> From: "Wanlong Gao" <gaowanlong@cn.fujitsu.com>
>> To: "Jan Stancek" <jstancek@redhat.com>
>> Cc: ltp-list@lists.sourceforge.net
>> Sent: Tuesday, November 8, 2011 4:07:56 AM
>> Subject: Re: [LTP] [PATCH] recvmsg01: kill child only if one was forked
>>
>> On 11/07/2011 08:53 PM, Jan Stancek wrote:
>>
>>>
>>> If start_server() fails, then pid will end up with -1 and
>>> cleanup() will do kill(-1, SIGKILL), which kills everything
>>> this process can kill.
>>>
>>> Change the test to kill pid (child) only when it successfully
>>> creates one.
>>>
>>
>>
>> Yeah, but this can't fix the problem in this case?
>>
>> recvmsg01 1 TBROK : server bind failed: errno=???(98): Address
>> already in use
>> recvmsg01 2 TBROK : Remaining cases broken
>>
>
> I'm not sure I follow you here.
> In case you described start_server() returns -1,
> so pid = -1, and cleanup won't do kill(-1, SIGKILL).
>
Yeah, I understood you.
But we wanna fix the case to TPASS but not TBROK, do we?
So, I mean that the issues of this case is not only what you said.
Thanks
-Wanlong Gao
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [LTP] [PATCH] recvmsg01: kill child only if one was forked
2011-11-08 7:21 ` Wanlong Gao
@ 2011-11-08 7:50 ` Jan Stancek
2011-11-08 8:08 ` Wanlong Gao
0 siblings, 1 reply; 7+ messages in thread
From: Jan Stancek @ 2011-11-08 7:50 UTC (permalink / raw)
To: gaowanlong; +Cc: ltp-list
----- Original Message -----
> From: "Wanlong Gao" <gaowanlong@cn.fujitsu.com>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: ltp-list@lists.sourceforge.net
> Sent: Tuesday, November 8, 2011 8:21:01 AM
> Subject: Re: [LTP] [PATCH] recvmsg01: kill child only if one was forked
>
> On 11/08/2011 03:14 PM, Jan Stancek wrote:
>
> >
> >
> > ----- Original Message -----
> >> From: "Wanlong Gao" <gaowanlong@cn.fujitsu.com>
> >> To: "Jan Stancek" <jstancek@redhat.com>
> >> Cc: ltp-list@lists.sourceforge.net
> >> Sent: Tuesday, November 8, 2011 4:07:56 AM
> >> Subject: Re: [LTP] [PATCH] recvmsg01: kill child only if one was
> >> forked
> >>
> >> On 11/07/2011 08:53 PM, Jan Stancek wrote:
> >>
> >>>
> >>> If start_server() fails, then pid will end up with -1 and
> >>> cleanup() will do kill(-1, SIGKILL), which kills everything
> >>> this process can kill.
> >>>
> >>> Change the test to kill pid (child) only when it successfully
> >>> creates one.
> >>>
> >>
> >>
> >> Yeah, but this can't fix the problem in this case?
> >>
> >> recvmsg01 1 TBROK : server bind failed: errno=???(98):
> >> Address
> >> already in use
> >> recvmsg01 2 TBROK : Remaining cases broken
> >>
> >
> > I'm not sure I follow you here.
> > In case you described start_server() returns -1,
> > so pid = -1, and cleanup won't do kill(-1, SIGKILL).
> >
>
>
> Yeah, I understood you.
>
> But we wanna fix the case to TPASS but not TBROK, do we?
True, but until we have such fix, we should at least make it
less annoying when it fails.
> So, I mean that the issues of this case is not only what you said.
I didn't actually get to see yet what those are, because those
TBROK messages didn't make it to log:
<<<test_start>>>
tag=recvmsg01 stime=1320555319
cmdline="recvmsg01"
contacts=""
analysis=exit
<<<test_output>>>
<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=signaled termination_id=9 corefile=no
cutime=0 cstime=0
<<<test_end>>>
Regards,
Jan
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [LTP] [PATCH] recvmsg01: kill child only if one was forked
2011-11-08 7:50 ` Jan Stancek
@ 2011-11-08 8:08 ` Wanlong Gao
0 siblings, 0 replies; 7+ messages in thread
From: Wanlong Gao @ 2011-11-08 8:08 UTC (permalink / raw)
To: Jan Stancek; +Cc: ltp-list
On 11/08/2011 03:50 PM, Jan Stancek wrote:
>
>
> ----- Original Message -----
>> From: "Wanlong Gao" <gaowanlong@cn.fujitsu.com>
>> To: "Jan Stancek" <jstancek@redhat.com>
>> Cc: ltp-list@lists.sourceforge.net
>> Sent: Tuesday, November 8, 2011 8:21:01 AM
>> Subject: Re: [LTP] [PATCH] recvmsg01: kill child only if one was forked
>>
>> On 11/08/2011 03:14 PM, Jan Stancek wrote:
>>
>>>
>>>
>>> ----- Original Message -----
>>>> From: "Wanlong Gao" <gaowanlong@cn.fujitsu.com>
>>>> To: "Jan Stancek" <jstancek@redhat.com>
>>>> Cc: ltp-list@lists.sourceforge.net
>>>> Sent: Tuesday, November 8, 2011 4:07:56 AM
>>>> Subject: Re: [LTP] [PATCH] recvmsg01: kill child only if one was
>>>> forked
>>>>
>>>> On 11/07/2011 08:53 PM, Jan Stancek wrote:
>>>>
>>>>>
>>>>> If start_server() fails, then pid will end up with -1 and
>>>>> cleanup() will do kill(-1, SIGKILL), which kills everything
>>>>> this process can kill.
>>>>>
>>>>> Change the test to kill pid (child) only when it successfully
>>>>> creates one.
>>>>>
>>>>
>>>>
>>>> Yeah, but this can't fix the problem in this case?
>>>>
>>>> recvmsg01 1 TBROK : server bind failed: errno=???(98):
>>>> Address
>>>> already in use
>>>> recvmsg01 2 TBROK : Remaining cases broken
>>>>
>>>
>>> I'm not sure I follow you here.
>>> In case you described start_server() returns -1,
>>> so pid = -1, and cleanup won't do kill(-1, SIGKILL).
>>>
>>
>>
>> Yeah, I understood you.
>>
>> But we wanna fix the case to TPASS but not TBROK, do we?
>
> True, but until we have such fix, we should at least make it
> less annoying when it fails.
>
>> So, I mean that the issues of this case is not only what you said.
>
> I didn't actually get to see yet what those are, because those
> TBROK messages didn't make it to log:
>
> <<<test_start>>>
> tag=recvmsg01 stime=1320555319
> cmdline="recvmsg01"
> contacts=""
> analysis=exit
> <<<test_output>>>
> <<<execution_status>>>
> initiation_status="ok"
> duration=0 termination_type=signaled termination_id=9 corefile=no
> cutime=0 cstime=0
> <<<test_end>>>
>
> Regards,
> Jan
>
You can do like this:
while [ $? -eq 0 ]; do ./recvmsg01; done
Then you can see the TBROK message.
-Wanlong Gao
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [LTP] [PATCH] recvmsg01: kill child only if one was forked
2011-11-07 12:53 [LTP] [PATCH] recvmsg01: kill child only if one was forked Jan Stancek
2011-11-08 3:07 ` Wanlong Gao
@ 2011-11-16 14:24 ` Cyril Hrubis
1 sibling, 0 replies; 7+ messages in thread
From: Cyril Hrubis @ 2011-11-16 14:24 UTC (permalink / raw)
To: Jan Stancek; +Cc: ltp-list
Hi!
> If start_server() fails, then pid will end up with -1 and
> cleanup() will do kill(-1, SIGKILL), which kills everything
> this process can kill.
>
> Change the test to kill pid (child) only when it successfully
> creates one.
Good catch, commited.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-11-16 14:18 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-07 12:53 [LTP] [PATCH] recvmsg01: kill child only if one was forked Jan Stancek
2011-11-08 3:07 ` Wanlong Gao
2011-11-08 7:14 ` Jan Stancek
2011-11-08 7:21 ` Wanlong Gao
2011-11-08 7:50 ` Jan Stancek
2011-11-08 8:08 ` Wanlong Gao
2011-11-16 14:24 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox