[Bug 220398] lio_listio(2) never sends asynchronous notification if nent==0

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Jun 30 21:53:05 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220398

            Bug ID: 220398
           Summary: lio_listio(2) never sends asynchronous notification if
                    nent==0
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: asomers at FreeBSD.org

Created attachment 183968
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=183968&action=edit
Reproduction program

It may seem stupid, but you can call lio_listio(2) with an empty aiocb list.  I
would naively expect lio_listio to do nothing and return in that case.  Indeed,
that's what it does when mode == LIO_WAIT.  However, if mode == LIO_NOWAIT,
then asynchronous notifications never get delivered.  With SIGEV_KEVENT, no
kevent is ever delivered, and with SIGEV_SIGNAL, no signal is ever delivered. 
I haven't checked other SIGEV_ values.

The attached program demonstrates the problem: it calls lio_listio with
LIO_NOWAIT and notification via SIGTERM.  But no signal ever gets delivered, so
the program exits normally.

jhb feels that the Open Group's specification is ambiguous on this point, but
that sending asynchronous notification immediately would be sensible.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list