[LTP] [PATCH 1/2] lib: initialize lib|main_pid to zero in the setup_ipc
Cyril Hrubis
chrubis@suse.cz
Wed May 14 10:00:40 CEST 2025
Hi!
> > > @@ -1393,8 +1396,6 @@ static void do_setup(int argc, char *argv[])
> > > if (tst_test->hugepages.number)
> > > tst_reserve_hugepages(&tst_test->hugepages);
> > >
> > > - setup_ipc();
> > > -
> >
> > I suppose that this has to go before the tst_reserve_hugepages() so that
> > we have results->lib_pid defined and properly clean up after the
> > hugepages. However for that to work we have to set the
> > results->lib_pid directly in the setup_ipc().
>
> In this patch, setup_ipc() is already moved up before the
> tst_reserve_hugpages(). I particularly put it after tst_test->runs_scripts,
> which is mandatory to have .child_needs_reinit initialized first.
>
> And the hugpages cleanup work is completed in tst_sys_conf_restore(0)
> in the do_cleanup, so that might not be a problem.
> I have validated that all hugetlb tests work well.
>
> Also,
>
> Or, did I miss anything?
The problem is that no library cleanup will happen unless lib_pid is
set, that means that tst_brk() will be triggered anywhere in do_setup()
the clanup will not be run because we set the lib_pid after the
do_setup() in the patch.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list