[LTP] [PATCH v4] unshare03.c: Add test coverage for dup_fd() failure handling in unshare_fd()

Wei Gao wegao@suse.com
Thu Mar 6 03:24:11 CET 2025


On Wed, Mar 05, 2025 at 01:11:20PM +0100, Andrea Cervesato wrote:
> Hi,
> 
> On 3/5/25 08:04, Wei Gao wrote:
> > > > +	if (!SAFE_CLONE(&args)) {
> > > > +		SAFE_FILE_PRINTF(FS_NR_OPEN, "%d", nr_open);
> > > > +		TST_EXP_FAIL(unshare(CLONE_FILES), EMFILE);
> > > > +		TST_CHECKPOINT_WAKE(0);
> > > There's no need to use synchronization mechanisms because at the end of the
> > > test we call tst_reap_children() waiting for all the children to be
> > > completed.
> > There are some race condition happen and trigger failure sometimes if you do not
> > use this synchronization(Currently no idea why this happen).
> > Rerun case 30 times can trigger 2 or 3 cases failed if not use synchronization in my env.
> 
> I'm really trying to reproduce this issue, but I can't. Run the test with
> 100000 iterations and it didn't stuck. Can you please check again? I tried
> on TW.

I have retest on my local machine with following builds, issue seems not happen:
* openSUSE Leap 15.5 5.14.21-150500.53-default
* Debian 6.12.0-rc4-00047-gc2ee9f594da8-dirty

so i suppose we can merge my latest v5 patch without sync.

> 
> Andrea


More information about the ltp mailing list