[LTP] [PATCH] pty04.c/pidfd_send_signal03.c: Drop redundant tst_reap_children()

Li Wang liwang@redhat.com
Tue Sep 13 12:10:38 CEST 2022


On Tue, Sep 13, 2022 at 5:34 PM luoxiaoyu (C) <luoxiaoyu9@huawei.com> wrote:

> Maybe I have a question to ask for.
> As my understand, tst_reap_children() has been called in API even test hit
> tst_brk, right?
>

To precisely, when hitting a tst_brk, the main process will invoke
do_test_cleanup()
and finally call tst_test->cleanup function from the specific testcase, to
recover the
original environment as much as they can.

In pidfd_send_signal03, the tst_reap_children will be invoked in that break
situation.
But we shouldn't say "it has been called in API", they're totally
different concepts.

see:
https://github.com/linux-test-project/ltp/blob/master/lib/tst_test.c#L339



>
> Regards,
> Luo
> -----origin mail-----
> Re: [LTP] [PATCH] pty04.c/pidfd_send_signal03.c: Drop redundant
> tst_reap_children()
>
> > On Tue, Sep 13, 2022 at 2:42 PM Petr Vorel <pvorel@suse.cz> wrote:
>
> > > Hi Luo,
>
> > > > Drop redundant calling of tst_reap_children() in cleanup() since
> > > > it has been called in the API (run_tests()).
>
> > > LGTM, I suppose that was a mistake.
>
>
> > Hmm, I slightly think that reflact a cautious thought from the author,
> > in case of test hit tst_brk unexpectly with invoke cleanup it can also
> > do reap children.
>
> > So, it's probably no harmful to keep tst_reap_children there.
> Ah, thx for info. I set status rejected in patchwork.
>
> Kind regards,
> Petr
>
>

-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20220913/33edde22/attachment.htm>


More information about the ltp mailing list