[LTP] [PATCH v2] lib/tst_test.c: Run test in child process

Jan Stancek jstancek@redhat.com
Wed Jun 8 15:36:23 CEST 2016



----- Original Message -----
> From: "Cyril Hrubis" <chrubis@suse.cz>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: ltp@lists.linux.it
> Sent: Wednesday, 8 June, 2016 3:15:15 PM
> Subject: Re: [LTP] [PATCH v2] lib/tst_test.c: Run test in child process
> 
> Hi!
> > > The cleanup_ipc() is intended to be executed just before the main pid
> > > exits since it unlinks the shm file.
> > 
> > So, if we fail a SAFE macro somewhere in lib/tst_test.c,
> > I don't see we ever call cleanup_ipc().
> > 
> > tst_run_tcases
> >  SAFE_WAITPID(test_pid, &status, 0);
> >   tst_brkm
> >    tst_brkm_
> >     tst_brk_
> >      tst_vbrk_
> >       exit
> > 
> > > If child TBROKs it's catched in the
> > > check_child_status() in the parent, tst_brk() is called which will call
> > > the cleanup_ipc().
> > 
> > Not anymore. After this patch the only place that now calls
> > cleanup_ipc() is do_exit().
> 
> Ah, right, that is since what was previously main_pid has been split
> into the library process and main test process.
> 
> Indeed the cleanup_ipc() should be called from the library in the
> tst_vbrk_().
...
> Looks good to me, acked.

Pushed.

Regards,
Jan


More information about the ltp mailing list