Issue #12117 has been reported by B Kelly.

----------------------------------------
Bug #12117: UDPSocket.new crash on win32 with "rb_update_max_fd: invalid fd (xxx) given"
https://bugs.ruby-lang.org/issues/12117

* Author: B Kelly
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.5p241 (2016-02-24 revision 53909) [i386-mswin32_100]
* Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
----------------------------------------
OS is Windows 7. The following command line reproduces the issue:

$ ruby22 -rsocket -e "UDPSocket.new(Socket::AF_INET)"

Output is:

~~~
-e:1: [BUG] rb_update_max_fd: invalid fd (176) given.
ruby 2.2.5p241 (2016-02-24 revision 53909) [i386-mswin32_100]

-- Control frame information -----------------------------------------------
c:0004 p:---- s:0010 e:000009 CFUNC  :initialize
c:0003 p:---- s:0008 e:000007 CFUNC  :new
c:0002 p:0020 s:0004 E:001964 EVAL   -e:1 [FINISH]
c:0001 p:0000 s:0002 E:000574 TOP    [FINISH]

-- Ruby level backtrace information ----------------------------------------
-e:1:in `<main>'
-e:1:in `new'
-e:1:in `initialize'

-- C level backtrace information -------------------------------------------
C:\Windows\SysWOW64\ntdll.dll(NtWaitForSingleObject+0x15) [0x76FBF971]
C:\Windows\syswow64\kernel32.dll(WaitForSingleObjectEx+0x43) [0x76861194]
C:\Windows\syswow64\kernel32.dll(WaitForSingleObject+0x12) [0x76861148]
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(rb_print_backtrace+0x2f) [0x722037FE] p:\code\ruby-git\ruby_2_2\vm_dump.c:712
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(rb_vm_bugreport+0x64) [0x72203864] p:\code\ruby-git\ruby_2_2\vm_dump.c:978
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(rb_bug+0x3f) [0x72188331] p:\code\ruby-git\ruby_2_2\error.c:409
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(rb_update_max_fd+0x42) [0x7217784C] p:\code\ruby-git\ruby_2_2\io.c:211
M:\dev\ruby-current\lib\ruby\2.2.0\i386-mswin32_100\socket.so(rsock_socket0+0x22) [0x683E1629] p:\code\ruby-git\ruby_2_2\ext\socket\init.c:319
M:\dev\ruby-current\lib\ruby\2.2.0\i386-mswin32_100\socket.so(rsock_socket+0x12) [0x683E1641] p:\code\ruby-git\ruby_2_2\ext\socket\init.c:330
M:\dev\ruby-current\lib\ruby\2.2.0\i386-mswin32_100\socket.so(udp_init+0x40) [0x683E988E] p:\code\ruby-git\ruby_2_2\ext\socket\udpsocket.c:37
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(call_cfunc_m1+0xf) [0x72169090] p:\code\ruby-git\ruby_2_2\vm_insnhelper.c:1208
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(vm_call0_cfunc_with_frame+0xd9) [0x7216D5CE] p:\code\ruby-git\ruby_2_2\vm_eval.c:127
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(vm_call0_body+0x142) [0x72173264] p:\code\ruby-git\ruby_2_2\vm_eval.c:184
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(vm_call0+0x38) [0x7217391B] p:\code\ruby-git\ruby_2_2\vm_eval.c:59
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(rb_call0+0x64) [0x72173A6E] p:\code\ruby-git\ruby_2_2\vm_eval.c:349
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(rb_call+0x22) [0x72173B4C] p:\code\ruby-git\ruby_2_2\vm_eval.c:616
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(rb_funcallv+0x16) [0x72173C3B] p:\code\ruby-git\ruby_2_2\vm_eval.c:831
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(rb_obj_call_init+0x32) [0x721424FC] p:\code\ruby-git\ruby_2_2\eval.c:1364
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(rb_class_new_instance+0x1a) [0x72158B37] p:\code\ruby-git\ruby_2_2\object.c:1862
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(call_cfunc_m1+0xf) [0x72169090] p:\code\ruby-git\ruby_2_2\vm_insnhelper.c:1208
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(vm_call_cfunc_with_frame+0xe2) [0x7216C7A2] p:\code\ruby-git\ruby_2_2\vm_insnhelper.c:1380
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(vm_call_cfunc+0x35) [0x7216C84F] p:\code\ruby-git\ruby_2_2\vm_insnhelper.c:1473
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(vm_call_general+0x24f) [0x7216F848] p:\code\ruby-git\ruby_2_2\vm_insnhelper.c:1844
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(vm_exec_core+0xadc) [0x721708DC] p:\code\ruby-git\ruby_2_2\insns.def:1070
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(vm_exec+0x44d) [0x7217258B] p:\code\ruby-git\ruby_2_2\vm.c:1435
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(rb_iseq_eval_main+0x64) [0x721726BA] p:\code\ruby-git\ruby_2_2\vm.c:1680
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(ruby_exec_internal+0xc5) [0x7214147F] p:\code\ruby-git\ruby_2_2\eval.c:255
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(ruby_exec_node+0x14) [0x72141520] p:\code\ruby-git\ruby_2_2\eval.c:317
M:\dev\ruby-current\bin\msvcr100-ruby220.dll(ruby_run_node+0x29) [0x72143549] p:\code\ruby-git\ruby_2_2\eval.c:309
M:\dev\ruby-current\bin\ruby22.exe(main+0x30) [0x011B1030] p:\code\ruby-git\ruby_2_2\main.c:36
M:\dev\ruby-current\bin\ruby22.exe(__tmainCRTStartup+0x122) [0x011B11C1] f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c:555
C:\Windows\syswow64\kernel32.dll(BaseThreadInitThunk+0x12) [0x7686338A]
C:\Windows\SysWOW64\ntdll.dll(RtlInitializeExceptionChain+0x63) [0x76FD9A02]

-- Other runtime information -----------------------------------------------

* Loaded script: -e

* Loaded features:

    0 enumerator.so
    1 rational.so
    2 complex.so
    3 M:/dev/ruby-current/lib/ruby/2.2.0/i386-mswin32_100/enc/encdb.so
    4 M:/dev/ruby-current/lib/ruby/2.2.0/i386-mswin32_100/enc/trans/transdb.so
    5 M:/dev/ruby-current/lib/ruby/2.2.0/i386-mswin32_100/enc/windows_1252.so
    6 M:/dev/ruby-current/lib/ruby/2.2.0/unicode_normalize.rb
    7 M:/dev/ruby-current/lib/ruby/2.2.0/i386-mswin32_100/rbconfig.rb
    8 thread.rb
    9 M:/dev/ruby-current/lib/ruby/2.2.0/i386-mswin32_100/thread.so
   10 M:/dev/ruby-current/lib/ruby/2.2.0/rubygems/compatibility.rb
   11 M:/dev/ruby-current/lib/ruby/2.2.0/rubygems/defaults.rb
   12 M:/dev/ruby-current/lib/ruby/2.2.0/rubygems/deprecate.rb
   13 M:/dev/ruby-current/lib/ruby/2.2.0/rubygems/errors.rb
   14 M:/dev/ruby-current/lib/ruby/2.2.0/rubygems/version.rb
   15 M:/dev/ruby-current/lib/ruby/2.2.0/rubygems/requirement.rb
   16 M:/dev/ruby-current/lib/ruby/2.2.0/rubygems/platform.rb
   17 M:/dev/ruby-current/lib/ruby/2.2.0/rubygems/basic_specification.rb
   18 M:/dev/ruby-current/lib/ruby/2.2.0/rubygems/stub_specification.rb
   19 M:/dev/ruby-current/lib/ruby/2.2.0/rubygems/util/stringio.rb
   20 M:/dev/ruby-current/lib/ruby/2.2.0/rubygems/specification.rb
   21 M:/dev/ruby-current/lib/ruby/2.2.0/rubygems/exceptions.rb
   22 M:/dev/ruby-current/lib/ruby/2.2.0/rubygems/core_ext/kernel_gem.rb
   23 M:/dev/ruby-current/lib/ruby/2.2.0/monitor.rb
   24 M:/dev/ruby-current/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb
   25 M:/dev/ruby-current/lib/ruby/2.2.0/rubygems.rb
   26 M:/dev/ruby-current/lib/ruby/2.2.0/i386-mswin32_100/socket.so
   27 M:/dev/ruby-current/lib/ruby/2.2.0/socket.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
~~~

Was not able to reproduce the problem under OS X.

But it's happening on both of our Windows 7 systems.


Regards,

Bill




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>