Page MenuHomeFreeBSD

Add regression tests for bugs 220459 and 220398
ClosedPublic

Authored by asomers on Jul 3 2017, 10:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 23 2024, 4:51 AM
Unknown Object (File)
Feb 22 2024, 1:16 AM
Unknown Object (File)
Feb 21 2024, 10:52 PM
Unknown Object (File)
Jan 16 2024, 2:23 PM
Unknown Object (File)
Jan 13 2024, 3:50 AM
Unknown Object (File)
Dec 20 2023, 2:18 AM
Unknown Object (File)
Jun 28 2023, 11:03 PM
Unknown Object (File)
Jun 28 2023, 11:00 PM
Subscribers

Details

Summary

Add regression tests for bugs 220459 and 220398

Bug 220398 - lio_listio(2) never sends asynchronous notification if nent==0
Bug 220459 - lio_listio(2) doesn't support SIGEV_THREAD

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Only some minor style nits below.

tests/sys/aio/lio_test.c
40–44 ↗(On Diff #30382)

style(9) puts a few extra newlines in here; between types and function names, as well as before opening function braces.

96 ↗(On Diff #30382)

I believe the space between ! and signaled should be removed, per style(9).

This revision is now accepted and ready to land.Jul 3 2017, 10:23 PM

I'll fix the style. In the meantime, since you seem to be interested in aio(4), do you want to review D11468 ?

Another option instead of 'signaled' might be to use a POSIX semaphore as you can 'sem_post' from a signal handler and you could then just do 'sem_wait' in the test bodies.

tests/sys/aio/lio_test.c
77 ↗(On Diff #30382)

Do you want to assert the fields in kq_returned? (EVFILT_LIO, &list and possibly set a value in sigev_value that will be in udata)

96 ↗(On Diff #30382)

It might be cleaner to use sigsuspend() instead of a loop with sleep? That is, something like:

sigset_t oset, set;

sigemptyset(&set);
sigaddset(&set, SIGUSR1);
sigprocmask(SIG_BLOCK, &set, &oset);
ATF_REQUIRE(SIG_ERR != signal(....));
ATF_REQUIRE(0 == lio_listio(...));
ATF_REQUIRE(-1 == sigsuspend(&oset));
ATF_REQUIRE_MSG(signaled, ...);
sigprocmask(SIG_SETMASK, &oset, NULL);

OTOH, maybe that is more code overall?

asomers edited edge metadata.
  • Use semaphore instead of polling
  • Validate the returned kevent's fields
This revision now requires review to proceed.Jul 13 2017, 5:34 PM
This revision is now accepted and ready to land.Jul 17 2017, 6:21 PM
This revision was automatically updated to reflect the committed changes.