Project

General

Profile

Bug #1146

TestSocket#test_udp_server hangs when configure --with-lookup-order-hack=INET

Added by znz (Kazuhiro NISHIYAMA) almost 11 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2dev (2009-02-12 trunk 22247) [i686-linux]
Backport:
[ruby-dev:37970]

Description

=begin
configureのときに--with-lookup-order-hack=INETをつけていると
Socket.udp_server_sockets(0) {|sockets| ... } で sockets に
IPv6で待ち受けていないのに、Socket.ip_address_list には IPv6 の
アドレスがあるので、IPv6でのsendmsgで止まってしまうようです。

以下のようにして調べてみると "::" の有無があることがわかります。

また、--with-lookup-order-hack=INET ありで止まってしまうときに
Ctrl+C を2回押さないと反応がありませんでした。

Index: test/socket/test_socket.rb
===================================================================
--- test/socket/test_socket.rb (revision 22249)
+++ test/socket/test_socket.rb (working copy)
@@ -233,6 +233,7 @@ class TestSocket < Test::Unit::TestCase
end

  Socket.udp_server_sockets(0) {|sockets|

+p sockets.map{|ai| ai.local_address.ip_address } - ip_addrs.map(&:ip_address)
begin
port = sockets.first.local_address.ip_port

--with-lookup-order-hack=INET なし:
% /tmp/r/bin/ruby -v ~/wc/ruby/trunk/test/socket/test_socket.rb -v
ruby 1.9.2dev (2009-02-12 trunk 22247) [i686-linux]
Loaded suite /home/kazu/wc/ruby/trunk/test/socket/test_socket
Started
TestSocket#test_accept_loop: 0.00 s: .
TestSocket#test_accept_loop_with_unix: 0.00 s: .
TestSocket#test_getaddrinfo: 0.00 s: .
TestSocket#test_getnameinfo: 0.00 s: .
TestSocket#test_initialize: 0.00 s: .
TestSocket#test_ip_address_list: 0.00 s: .
TestSocket#test_socket_new: 0.00 s: .
TestSocket#test_sysaccept: 0.00 s: .
TestSocket#test_tcp: 0.00 s: .
TestSocket#test_tcp_server_sockets: 0.00 s: .
TestSocket#test_tcp_server_sockets_port0: 0.00 s: .
TestSocket#test_udp_server: ["::"]
0.01 s: .
TestSocket#test_unix: 0.00 s: .
TestSocket#test_unix_server_socket: 0.00 s: .
TestSocket#test_unpack_sockaddr: 0.00 s: .

Finished in 0.042818 seconds.

15 tests, 68 assertions, 0 failures, 0 errors, 0 skips
%

--with-lookup-order-hack=INET あり:
% /tmp/r2/bin/ruby -v ~/wc/ruby/trunk/test/socket/test_socket.rb -v
ruby 1.9.2dev (2009-02-12 trunk 22247) [i686-linux]
Loaded suite /home/kazu/wc/ruby/trunk/test/socket/test_socket
Started
TestSocket#test_accept_loop: 0.00 s: .
TestSocket#test_accept_loop_with_unix: 0.00 s: .
TestSocket#test_getaddrinfo: 0.00 s: .
TestSocket#test_getnameinfo: 0.00 s: .
TestSocket#test_initialize: 0.00 s: .
TestSocket#test_ip_address_list: 0.00 s: .
TestSocket#test_socket_new: 0.00 s: .
TestSocket#test_sysaccept: 0.00 s: .
TestSocket#test_tcp: 0.00 s: .
TestSocket#test_tcp_server_sockets: 0.00 s: .
TestSocket#test_tcp_server_sockets_port0: 0.00 s: .
TestSocket#test_udp_server: []
CC1.77 s: E
TestSocket#test_unix: 0.00 s: .
TestSocket#test_unix_server_socket: 0.00 s: .
TestSocket#test_unpack_sockaddr: 0.00 s: .

Finished in 1.780257 seconds.

1) Error:
test_udp_server(TestSocket):
Interrupt:
/home/kazu/wc/ruby/trunk/test/socket/test_socket.rb:260:in sendmsg'
/home/kazu/wc/ruby/trunk/test/socket/test_socket.rb:260:in
block (2 levels) in test_udp_server'

15 tests, 54 assertions, 0 failures, 1 errors, 0 skips
%
=end

History

#1

Updated by akr (Akira Tanaka) almost 11 years ago

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

=begin
Applied in changeset r22260.
=end

Also available in: Atom PDF