Page MenuHomeFreeBSD

sysv test: properly wait for children
ClosedPublic

Authored by vangyzen on May 12 2022, 10:43 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 4, 8:38 AM
Unknown Object (File)
Feb 7 2024, 5:56 AM
Unknown Object (File)
Jan 29 2024, 7:11 AM
Unknown Object (File)
Jan 29 2024, 7:11 AM
Unknown Object (File)
Jan 29 2024, 7:10 AM
Unknown Object (File)
Jan 29 2024, 7:10 AM
Unknown Object (File)
Jan 27 2024, 5:48 PM
Unknown Object (File)
Jan 17 2024, 10:27 PM

Details

Summary

In the msg and shm tests, if the child exited before the parent
entered sigsuspend(), the test would hang and time out. This was
also a problem in the sem test, but the misuse of atf_tc_pass()
masked it. Adding a short sleep before the sigsuspend() calls made
the hang 100% reliable. With the same sleep in the new version,
the test passes reliably.

Remove calls to atf_tc_pass(). The call in the sem test broke the test
by exiting prematurely, after only one child out of five had finished.
The other two were harmless but unhelpful.

Reduce a one-second sleep to a more reasonable duration so I can quickly
run many iterations of the test.

Re-enable the test in CI.

PR: 233649
MFC after: 1 week
Sponsored by: Dell EMC Isilon

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Seems rather bizarre not to use wait() to begin with. I can't see a reason why it was done this way. :/

contrib/netbsd-tests/kernel/t_sysv.c
681

Maybe assert that wait_result == child_pid just for good measure?

This revision is now accepted and ready to land.May 13 2022, 1:27 PM
  • Review feedback, and more
This revision now requires review to proceed.May 13 2022, 5:55 PM

Seems rather bizarre not to use wait() to begin with. I can't see a reason why it was done this way. :/

My thoughts exactly. I actually looked for any unusual, specific interaction between signals and these SysV facilities, and of course found none.

Sorry for the large update. This code just keeps on giving.

This revision was not accepted when it landed; it landed in state Needs Review.May 13 2022, 9:40 PM
This revision was automatically updated to reflect the committed changes.