Nonblocking I/O and POLL_BUG
rra at stanford.edu
Tue Oct 26 08:39:14 UTC 1999
Per Hedeland <per at erix.ericsson.se> writes:
> Russ Allbery wrote:
>> (I've seen a different bug on Linux with 2.0.x kernels, namely a write
>> to a socket that has been set nonblocking blocking anyway. Solution
>> there was to put a call to select in front of it.)
> Ouch, that's a *much* worse bug! Could affect INN I guess, as
> CHANwrite() seems to attempt more than one write after select in some
> (weird:-) cases.
I don't know how reproducible it is. We ran into it when a chatserver
started periodically hanging for several seconds when run on Linux (not
that frequently, but occasionally) and we couldn't figure out what was
going on. Putting the select in front fixed it, which gives me a strong
suspicion as to what the problem was.
We ran into some other odd problems with Linux in that same project, like
non-blocking status not being inherited from the accepting file descriptor
for a server, but that seems to just be inconsistent across operating
systems. And there was some weirdness with non-blocking connect too, as I
recall. This was a while back, though; I don't know how the same code
would fare against modern kernels.
Russ Allbery (rra at stanford.edu) <URL:http://www.eyrie.org/~eagle/>
More information about the inn-workers