Messages in this thread |  | | From | Paul Marquis <> | Date | Thu, 02 Nov 2000 17:11:24 -0500 | Subject | select() bug |
| |
I've uncovered a bug in select() when checking if it's okay to write on a pipe. It will report "false negatives" if there is any unread data already on the pipe, even a single byte. As soon as the pipe gets flushed, select() does the right thing.
Normally, I wouldn't think this such a big deal, except that Apache uses the writability of s pipe to determine if any of its children that are log file handlers are dead. If select() reports it can't write immediately, Apache terminates and restarts the child process, creating unnecessary load on the system.
The bug exists in the 2.2.x kernels up to and including 2.2.17 that I've tried and I don't know it extends beyond pipes. I've attached sample code to demonstrate the problem, which works correctly on BSD and Solaris.
Is this a know bug?
-- Paul Marquis pmarquis@iname.com
If it's tourist season, why can't we shoot them?
[unhandled content-type:application/octet-stream] |  |