This report is here to document a past fix, but is nonetheless important as a reference for people encountering the associated bugs in older versions, since these bugs have not been reported here.
Prior to Check-in [e496f9ef50] by Daniel A. Steffen, 2009-04-10 20:46:21,
* unix/tclUnixChan.c: TclUnixWaitForFile(): use FD_* macros * macosx/tclMacOSXNotify.c: to manipulate select masks (Cassoff). Bug 1960647
there were dangerously non-portable shift manipulations in TclUnixWaitForFile(). These have been properly replaced by the clean FD_SET et al. macros by Daniel.
Here is the behavior, observed independently by me on 8.4.13 and by evilotto on 8.4.12, both on x84_64 Linux:
A fileevent readable on a high descriptor (above 32) repeatedly fires, but the [read]s done on it don't consume any bytes, leading to a busyloop known as "select bomb". The failing bitshifts misdirected the setting of the select() bits.
Attached scripts, courtesy of evilotto, expose the behavior.
Also, the problem is likely to occur under load when using [package require httpd] asynchronously (many simultaneous requests must be active).
SelectBomb1 : the server
SelectBomb2: the FAILING proxy
SelectBomb3: the client. Not failing below 16.
Closing since it was fixed nearly 3 yrs ago.
Reopening since it was never backported to 8.4.
Pending specific action, the 8.4 branch remains crippled in that regard: don't use 8.4 on x86_64 !!!
In case a 8.4.20 is rolled out...
Daniel, any objection against a backport of this specific cleanup to 8.4 ?
none at all, please feel free!
Committed to tip of core-8-4-branch