Damien Miller
2022-Jan-11 22:42 UTC
OS X poll breakage (Was: Please help test recent changes)
On Tue, 11 Jan 2022, Demi Marie Obenour wrote:> > Wow, it looks like Darwin's poll(2) is completely broken for > > character- special devices (at least). E.g. the attached program > > spins shows similar behaviour when run on /dev/null - it spins, > > returning revents=POLLNVAL. > > Is using kqueue(2) an option? That?s faster, and it doesn?t have the > problem with large file descriptors that poll(2) has.No, because it's not cross-platform and I don't want to have to maintain multiple mainloops (believe me, one is more than enough). It would have been really nice if the OSS Unix-like operating systems has standardised on one event notification; kqueue and epoll are both fine. Also, it seems like the OS X kqueue(2) implementation suffers from the same bug anyway. I suspect that this is the root cause, and that their poll(2) is built on top of kqueue(2). -d
Nicholas Marriott
2022-Jan-12 21:02 UTC
OS X poll breakage (Was: Please help test recent changes)
epoll doesn't (or didn't) work with /dev/null either in any case. Only select works on everything on macOS and only poll or select on Linux. On Tue, 11 Jan 2022, 22:46 Damien Miller, <djm at mindrot.org> wrote:> On Tue, 11 Jan 2022, Demi Marie Obenour wrote: > > > > Wow, it looks like Darwin's poll(2) is completely broken for > > > character- special devices (at least). E.g. the attached program > > > spins shows similar behaviour when run on /dev/null - it spins, > > > returning revents=POLLNVAL. > > > > Is using kqueue(2) an option? That?s faster, and it doesn?t have the > > problem with large file descriptors that poll(2) has. > > No, because it's not cross-platform and I don't want to have to maintain > multiple mainloops (believe me, one is more than enough). It would have > been really nice if the OSS Unix-like operating systems has standardised > on one event notification; kqueue and epoll are both fine. > > Also, it seems like the OS X kqueue(2) implementation suffers from the > same bug anyway. I suspect that this is the root cause, and that their > poll(2) is built on top of kqueue(2). > > -d > _______________________________________________ > openssh-unix-dev mailing list > openssh-unix-dev at mindrot.org > https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev >
Demi Marie Obenour
2022-Jan-13 06:07 UTC
OS X poll breakage (Was: Please help test recent changes)
On 1/11/22 17:42, Damien Miller wrote:> On Tue, 11 Jan 2022, Demi Marie Obenour wrote: > >>> Wow, it looks like Darwin's poll(2) is completely broken for >>> character- special devices (at least). E.g. the attached program >>> spins shows similar behaviour when run on /dev/null - it spins, >>> returning revents=POLLNVAL. >> >> Is using kqueue(2) an option? That?s faster, and it doesn?t have the >> problem with large file descriptors that poll(2) has. > > No, because it's not cross-platform and I don't want to have to maintain > multiple mainloops (believe me, one is more than enough). It would have > been really nice if the OSS Unix-like operating systems has standardised > on one event notification; kqueue and epoll are both fine. > > Also, it seems like the OS X kqueue(2) implementation suffers from the > same bug anyway. I suspect that this is the root cause, and that their > poll(2) is built on top of kqueue(2).What about filtering out file descriptors belonging to /dev files? -- Sincerely, Demi Marie Obenour (she/her/hers) -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_0xB288B55FFF9C22C1.asc Type: application/pgp-keys Size: 4885 bytes Desc: OpenPGP public key URL: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20220113/b5ba7509/attachment-0001.bin> -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature URL: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20220113/b5ba7509/attachment-0001.asc>