From: KOSAKI Motohiro Date: 2011-09-14T12:01:40+09:00 Subject: [ruby-core:39537] Re: [Ruby 1.9 - Bug #5306] Application Hangs Due to Recent rb_thread_select Changes > BTW, I've checked kosaki-san's patch with x64-mswin64. > No problem was reported in test. > > P.S. > kosaki-san, I want to add a guard to your patch. > > --- thread.c.bak � � � �2011-09-13 03:40:05.948172400 +0900 > +++ thread.c � �2011-09-13 03:40:24.308222500 +0900 > @@ -2469,7 +2469,9 @@ rb_fd_rcopy(fd_set *dst, rb_fdset_t *src > �{ > � � int max = rb_fd_max(src); > > - � �if (max > FD_SETSIZE) { > + � �/* we assume src is the result of select() with dst, so dst should be > + � � * larger or equal than src. */ > + � �if (max > FD_SETSIZE || max > dst->fd_count) { > � � � �rb_raise(rb_eArgError, "too large fdsets"); Done. Thank you for careful reviewing!