Ruby 1.8.7 IO#select threading bug

I just spent most of a day tracking down a rather obscure Ruby interpreter bug involving multiple threads calling IO#select. Basically, what happens is, if you are running Ruby 1.8.7p160 through 1.8.7p174 (and possibly some later versions), and you have multiple threads calling IO#select on different and disjoint sets of IO objects, the calls may fail to return results even though there are results to return. Continue reading