Project

General

Profile

Actions

Bug #714

closed

Socket bug in Ruby-mswin32

Added by phasis68 (Heesob Park) over 15 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
[ruby-core:19713]

Description

=begin
All 1.8.6/1.8.7 releases in http://www.garbagecollect.jp/ruby/mswin32/en/download/release.html and also One-Click Installer since 1.8.6 fail to work

s = Socket.new(Socket::AF_INET, Socket::SOCK_RAW,1)

like this:

irb(main):001:0> require 'socket'
=> true
irb(main):002:0> s = Socket.new(Socket::AF_INET, Socket::SOCK_RAW,1)
(irb):3: [BUG] rb_sys_fail(socket(2)) - errno == 0
ruby 1.8.6 (2008-08-11) [i386-mswin32]

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

irb(main):001:0> require 'socket'
=> true
irb(main):002:0> s = Socket.new(Socket::AF_INET, Socket::SOCK_RAW,1)
(irb):2: [BUG] rb_sys_fail(socket(2)) - errno == 0
ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-mswin32]

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

I suspect it is related with USE_WINSOCK2 macro or --with-winsock2 build option.
=end

Actions #1

Updated by rogerdpack (Roger Pack) over 15 years ago

=begin
yep I get this also with 1.9 [snapshot] and 1.8.6 mingw.
=end

Actions #2

Updated by phasis68 (Heesob Park) over 15 years ago

=begin
Here is a patch for 1.8.6-p114

--- win32.c 2008-11-07 23:00:01.000000000 +0900
+++ win32.c.new 2008-11-07 23:03:26.000000000 +0900
@@ -2450,6 +2450,8 @@
out = WSASocket(af, type, protocol, &(proto_buffers[i]), 0, 0);
break;
}

  •           if(out==INVALID_SOCKET)
    
  •              out = WSASocket(af, type, protocol, NULL, 0, 0);
          }
    
          free(proto_buffers);
    

=end

Actions #3

Updated by rogerdpack (Roger Pack) over 15 years ago

=begin
do you need to surround the added lines [in the patch] with some macros so that it only runs those lines on windows?

-=R
=end

Actions #4

Updated by usa (Usaku NAKAMURA) over 15 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r20166.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0