Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 146321 - ruby gem_server failes with getnameinfo: ai_family not supported
Summary: ruby gem_server failes with getnameinfo: ai_family not supported
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-04 15:02 UTC by Roy Wright
Modified: 2007-02-23 15:46 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roy Wright 2006-09-04 15:02:03 UTC
If ruby-1.8.5 is compiled without IPV6, running gem_server will generate the following error:

2006-09-04 16:49:30] INFO  WEBrick 1.3.1
[2006-09-04 16:49:30] INFO  ruby 1.8.5 (2006-08-25) [i686-linux]
/usr/lib/ruby/1.8/webrick/utils.rb:63:in `getaddrinfo': getnameinfo: ai_family not supported (SocketError)
        from /usr/lib/ruby/1.8/webrick/utils.rb:63:in `create_listeners'
        from /usr/lib/ruby/1.8/webrick/server.rb:75:in `listen'
        from /usr/lib/ruby/1.8/webrick/server.rb:63:in `initialize'
        from /usr/lib/ruby/1.8/webrick/httpserver.rb:24:in `initialize'
        from /usr/bin/gem_server:351:in `new'
        from /usr/bin/gem_server:351

The cause is this line in /usr/lib/ruby/1.8/webrick/utils.rb:

      res = Socket::getaddrinfo(address, port,
                                Socket::AF_UNSPEC,   # address family
                                Socket::SOCK_STREAM, # socket type
                                0,                   # protocol
                                Socket::AI_PASSIVE)  # flag

The problem is the Socket::AF_UNSPEC which is apparently causing getaddrinfo to try some IPv6 processing.

What is needed is when -IPV6, to replace Socket::AF_UNSPEC with Socket::AF_INET to restrict getaddrinfo to IPv4:

      res = Socket::getaddrinfo(address, port,
                                Socket::AF_INET,   # address family
                                Socket::SOCK_STREAM, # socket type
                                0,                   # protocol
                                Socket::AI_PASSIVE)  # flag
Comment 1 Caleb Tennis (RETIRED) gentoo-dev 2006-09-04 16:52:17 UTC
Can you file a bug at the ruby bugs site so they can fix this directly in ruby?

I think the URL is  http://rubyforge.org/tracker/?func=add&group_id=426&atid=1698

Comment 2 Roy Wright 2006-09-04 22:53:01 UTC
(In reply to comment #1)
> Can you file a bug at the ruby bugs site so they can fix this directly in ruby?

Filed at http://rubyforge.org/tracker/index.php?func=detail&aid=5627&group_id=426&atid=1698

Comment 3 Nguyen Thai Ngoc Duy (RETIRED) gentoo-dev 2007-02-23 15:46:07 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Can you file a bug at the ruby bugs site so they can fix this directly in ruby?
> 
> Filed at
> http://rubyforge.org/tracker/index.php?func=detail&aid=5627&group_id=426&atid=1698
> 

Closed as UPSTREAM. I don't think we have time for this bug in the moment.