Bug 229741 - kevent is not properly adding EVFILT_READ and EVFILT_WRITE for unix sockets when used in one call
Summary: kevent is not properly adding EVFILT_READ and EVFILT_WRITE for unix sockets w...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.1-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-12 18:51 UTC by Ivan Radovanovic
Modified: 2019-11-02 13:08 UTC (History)
3 users (show)

See Also:


Attachments
simple test (3.90 KB, text/plain)
2018-07-12 18:51 UTC, Ivan Radovanovic
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Radovanovic 2018-07-12 18:51:35 UTC
Created attachment 195091 [details]
simple test

When adding two events to watch (EVFILT_READ and EVFILT_WRITE) in single call kevent is not handling them properly (at least for unix sockets). If both are added in one call which one is reported depends on their order; however if they are added using 2 calls everything works as expected

I.e.

struct kevent kev[2];
...
kevent(kqueue, kev, 2, NULL, 0, NULL);

and

struct kevent kev[2];
...
kevent(kqueue, kev, 1, NULL, 0, NULL);
kevent(kqueue, kev + 1, 1, NULL, 0, NULL); 

do not give identical results.

Simple test case is attached - expected result would be for test program to output at least one line saying:

BothReadWrite received EVFILT_WRITE
Comment 1 Ivan Radovanovic 2018-07-12 18:53:34 UTC
I don't know how to add other versions but it is the same behavior on 11.0 and 11.1