Forum: Ruby-core [Bug #2319] gethostbyname fails in windows

Posted by Roger Pack (Guest)
on 2009-10-31 23:18
(Received via mailing list)
Bug #2319: gethostbyname fails in windows
http://redmine.ruby-lang.org/issues/show/2319

Author: Roger Pack
Status: Open, Priority: Normal
ruby -v: ruby 1.9.2dev (2009-10-26 trunk 25491) [i386-mingw32]

Unfortunately this appears to prevent me from running other tests...

C:\dev\ruby\downloads\ruby_trunk>make test-all
./miniruby.exe -I./lib -I.ext/common -I./- -r./ext/purelib.rb 
./tool/runruby.rb --extout=.ext  -- "./test/runner.rb"
C:/dev/ruby/downloads/ruby_trunk/lib/drb/drb.rb:834: [BUG] Segmentation 
fault
ruby 1.9.2dev (2009-11-01 trunk 25603) [i386-mingw32]

-- control frame ----------
c:0021 p:---- s:0088 b:0088 l:000087 d:000087 CFUNC  :gethostbyname
c:0020 p:0058 s:0084 b:0084 l:000083 d:000083 METHOD 
C:/dev/ruby/downloads/ruby_trunk/lib/drb/drb.rb:834
c:0019 p:0053 s:0080 b:0080 l:000079 d:000079 METHOD 
C:/dev/ruby/downloads/ruby_trunk/lib/drb/ssl.rb:139
c:0018 p:0019 s:0070 b:0070 l:000061 d:000069 BLOCK 
C:/dev/ruby/downloads/ruby_trunk/lib/drb/drb.rb:759
c:0017 p:---- s:0067 b:0067 l:000066 d:000066 FINISH
...

gethostbyname works fine with 1.9.1

Thanks!
-r
Posted by Usaku NAKAMURA (Guest)
on 2009-11-02 03:00
(Received via mailing list)
Issue #2319 has been updated by Usaku NAKAMURA.

Assigned to set to Nobuyoshi Nakada

FYI, this problem only occurs with mingw version.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2319
Posted by Roger Pack (Guest)
on 2009-11-08 06:04
(Received via mailing list)
Issue #2319 has been updated by Roger Pack.


Perhaps it is getting confused between ipv6 and 4? (after compiling with 
-g3

(gdb) print *addr
$6 = {sin6_family = -1912, sin6_port = 34, sin6_flowinfo = 1851828526, 
sin6_addr = {_S6_un = {_S6_u8 = "╕{>\000╨Y\236\000p¿`n\002\000\000", 
_S6_u16 = {31672, 62, 22992, 158,
        43120, 28256, 2, 0}, _S6_u32 = {4094904, 10377680, 1851828336, 
2}}}, sin6_scope_id = 4102464}
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
make_hostent_internal (arg=0x6e614d88) at raddrinfo.c:431
431         if (addr->ai_canonname) {
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2319
Posted by Roger Pack (Guest)
on 2010-01-25 16:02
(Received via mailing list)
Issue #2319 has been updated by Roger Pack.


Just as a note, this still occurs (I think only with GCC 3.4.5 mingw)

e:\dev\digitalarchive_trunk>ruby -rsocket -e 
'Socket.gethostbyname("localhost")'
-e:1: [BUG] Segmentation fault
ruby 1.9.2dev (2010-01-24 trunk 26393) [i386-mingw32]

-- control frame ----------
c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC  :gethostbyname
c:0003 p:0017 s:0006 b:0006 l:0021a4 d:0021cc EVAL   -e:1
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0021a4 d:0021a4 TOP
---------------------------
-e:1:in `<main>'
-e:1:in `gethostbyname'

Thanks much.
-r
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2319
Posted by Nobuyoshi Nakada (Guest)
on 2010-01-30 02:12
(Received via mailing list)
Issue #2319 has been updated by Nobuyoshi Nakada.

Status changed from Open to Feedback

I can't reproduce it on Windows Vista at all.
What's your platform, and the version of winsock2?
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2319
Posted by Roger Pack (Guest)
on 2010-01-30 02:22
(Received via mailing list)
Issue #2319 has been updated by Roger Pack.


XP Pro, ws2_32.dll => 5.1.2600.5512 (gcc 3.4.5)
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2319
Posted by Nobuyoshi Nakada (nobu)
on 2010-01-30 02:35
(Received via mailing list)
Hi,

At Sat, 30 Jan 2010 10:21:58 +0900,
Roger Pack wrote in [ruby-core:27962]:
> XP Pro, ws2_32.dll => 5.1.2600.5512 (gcc 3.4.5)

It's 6.0.6001.18000 on Vista.

I'll try it on XP, if possible, later.
Posted by Vladimir Sizikov (Guest)
on 2010-01-30 12:06
(Received via mailing list)
Issue #2319 has been updated by Vladimir Sizikov.


Easily reproducible on Windows 7 with latest 1.9.2 dev builds (with 
*MINGW*):

D:\work\jruby-dev>pik ruby -rsocket -e "p 
Socket.gethostbyname('localhost')"
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

["Oxford", [], 2, "\177\000\000\001"]

ruby 1.8.6 (2009-08-04 patchlevel 383) [i386-mingw32]

["Oxford", [], 2, "\177\000\000\001"]

ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-cygwin]

["Oxford", [], 2, "\177\000\000\001"]

ruby 1.8.7 (2009-06-12 patchlevel 174) [i386-mswin32]

["Oxford", [], 2, "\177\000\000\001"]

ruby 1.9.0 (2008-06-20 revision 17482) [i386-mswin32]

["Oxford", [], 2, "\x7F\x00\x00\x01"]

ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-mswin32]

["Oxford", [], 2, "\x7F\x00\x00\x01"]

ruby 1.9.1p0 (2009-01-30 revision 21907) [x64-mswin64_80]

-e:1:in `gethostbyname': unknown socket family:23 (SocketError)
        from -e:1:in `<main>'

ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-mswin32]

["Oxford", [], 2, "\x7F\x00\x00\x01"]

ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]

["Oxford", [], 2, "\x7F\x00\x00\x01"]

ruby 1.9.2dev (2009-07-18) [i386-mswin32]

["Oxford", [], 2, "\x7F\x00\x00\x01"]

ruby 1.9.2dev (2009-11-12 trunk 25723) [i386-mingw32]

-e:1: [BUG] Segmentation fault
ruby 1.9.2dev (2009-11-12 trunk 25723) [i386-mingw32]

-- control frame ----------
c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC  :gethostbyname
c:0003 p:0018 s:0007 b:0006 l:0004ac d:00205c EVAL   -e:1
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0004ac d:0004ac TOP
---------------------------
-e:1:in `<main>'
-e:1:in `gethostbyname'

[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


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

ruby 1.9.2dev (2010-01-25 trunk 26402) [i386-mingw32]

-e:1: [BUG] Segmentation fault
ruby 1.9.2dev (2010-01-25 trunk 26402) [i386-mingw32]

-- control frame ----------
c:0004 p:---- s:0011 b:0011 l:000010 d:000010 CFUNC  :gethostbyname
c:0003 p:0018 s:0007 b:0006 l:00042c d:001b6c EVAL   -e:1
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:00042c d:00042c TOP
---------------------------
-e:1:in `<main>'
-e:1:in `gethostbyname'
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2319
Posted by Roger Pack (Guest)
on 2010-03-05 23:31
(Received via mailing list)
Issue #2319 has been updated by Roger Pack.


appears to not throw the segfault anymore...at least on a couple of my 
doze boxes.

e:\dev\digitalarchive_trunk>ruby -v -rsocket -e 'p 
Socket.gethostbyname("localhost")'
ruby 1.9.2dev (2010-03-06) [i386-mingw32]
["roger-pack", [], 2, "\x7F\x00\x00\x01"]


C:\dev\ruby\downloads>ruby -v -rsocket -e 'p 
Socket.gethostbyname("localhost")'
ruby 1.9.2dev (2009-08-09 trunk 24478) [i386-mingw32]
["ws-packrd", [], 2, "\x7F\x00\x00\x01"]


Anybody else seeing it?
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2319
Posted by Roger Pack (Guest)
on 2010-03-23 19:03
(Received via mailing list)
Issue #2319 has been updated by Roger Pack.

Status changed from Feedback to Closed

Seems to be working now.
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2319
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.