Hello,

In message "[ruby-core:39483] [Ruby 1.9 - Bug #5306] Application Hangs Due to Recent rb_thread_select Changes"
    on Sep.13,2011 01:29:28, <cfis / savagexi.com> wrote:
> File mingw_backtrace.txt added
> 
> Thanks for all the effort.  But sorry, not fixed yet.  This version segfaults on MinGW.  Trace attached.  Will check mswin next.

Hmm, did you do make install before running the test?
C level backtrace information of your trace says that the ruby
core dll is c:\MinGW\local\ruby\bin\msvcrt-ruby191.dll .
I guess that your build path is c:/MinGW/local/src/ruby, and
the built ruby core dll is c:/MinGW/local/src/ruby/msvcrt-ruby191.dll .

If you want to test safely, run as follows:
  make test-all TESTS="-- -ext-/old_thread_select"


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"); }
Regards, -- U.Nakamura <usa / garbagecollect.jp>