Project

General

Profile

Actions

Bug #8627

closed

Socket.pack_sockaddr_in crashes ruby

Added by xinjin (Sujin Phil) over 11 years ago. Updated over 10 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
[ruby-core:55958]

Description

(({
2.0.0p247 :001 > require 'socket'
=> true
2.0.0p247 :002 > Socket.pack_sockaddr_in(500, "fdgfdgd")
(irb):2: [BUG] rb_sys_fail(getaddrinfo) - errno == 0
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]

-- Control frame information -----------------------------------------------
c:0019 p:---- s:0077 e:000076 CFUNC :pack_sockaddr_in
c:0018 p:0015 s:0072 e:000071 EVAL (irb):2 [FINISH]
c:0017 p:---- s:0070 e:000069 CFUNC :eval
c:0016 p:0024 s:0063 e:000062 METHOD /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/workspace.rb:86
c:0015 p:0025 s:0056 e:000054 METHOD /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/context.rb:380
c:0014 p:0022 s:0050 e:000049 BLOCK /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb.rb:492
c:0013 p:0040 s:0042 e:000041 METHOD /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb.rb:624
c:0012 p:0009 s:0037 e:000036 BLOCK /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb.rb:489
c:0011 p:0118 s:0033 e:000032 BLOCK /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/ruby-lex.rb:247 [FINISH]
c:0010 p:---- s:0030 e:000029 CFUNC :loop
c:0009 p:0007 s:0027 e:000026 BLOCK /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/ruby-lex.rb:233 [FINISH]
c:0008 p:---- s:0025 e:000024 CFUNC :catch
c:0007 p:0015 s:0021 e:000020 METHOD /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/ruby-lex.rb:232
c:0006 p:0030 s:0018 E:0020f8 METHOD /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb.rb:488
c:0005 p:0008 s:0015 e:000014 BLOCK /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb.rb:397 [FINISH]
c:0004 p:---- s:0013 e:000012 CFUNC :catch
c:0003 p:0143 s:0009 E:0004b8 METHOD /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb.rb:396
c:0002 p:0122 s:0004 E:001048 EVAL /home/developer/.rvm/rubies/ruby-2.0.0-p247/bin/irb:16 [FINISH]
c:0001 p:0000 s:0002 E:002308 TOP [FINISH]

corresponding jruby behaviour
jruby-1.7.4 :001 > require 'socket'
=> true
jruby-1.7.4 :002 > Socket.pack_sockaddr_in(500, "fdgfdgd")
SocketError: getaddrinfo: No address associated with nodename
from org/jruby/ext/socket/RubySocket.java:266:in pack_sockaddr_in' from (irb):2:in evaluate'
from org/jruby/RubyKernel.java:1093:in eval' from org/jruby/RubyKernel.java:1489:in loop'
from org/jruby/RubyKernel.java:1254:in catch' from org/jruby/RubyKernel.java:1254:in catch'
from /home/developer/.rvm/rubies/jruby-1.7.4/bin/irb:13:in `(root)'
}))


Files

strace.txt (573 KB) strace.txt Socket.pack_sockaddr_in crash strace xinjin (Sujin Phil), 07/13/2013 03:19 AM

Updated by xinjin (Sujin Phil) over 11 years ago

/home/developer/.rvm/rubies/ruby-2.0.0-p247/bin/irb:16:in <main>' /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb.rb:396:in start'
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb.rb:396:in catch' /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb.rb:397:in block in start'
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb.rb:488:in eval_input' /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/ruby-lex.rb:232:in each_top_level_statement'
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/ruby-lex.rb:232:in catch' /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/ruby-lex.rb:233:in block in each_top_level_statement'
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/ruby-lex.rb:233:in loop' /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/ruby-lex.rb:247:in block (2 levels) in each_top_level_statement'
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb.rb:489:in block in eval_input' /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb.rb:624:in signal_status'
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb.rb:492:in block (2 levels) in eval_input' /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/context.rb:380:in evaluate'
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/workspace.rb:86:in evaluate' /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/workspace.rb:86:in eval'
(irb):2:in irb_binding' (irb):2:in pack_sockaddr_in'

-- C level backtrace information -------------------------------------------
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x1b2c48) [0x7f6e180fec48] vm_dump.c:647
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x6cdc7) [0x7f6e17fb8dc7] error.c:283
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(rb_bug+0xb3) [0x7f6e17fb9b13] error.c:302
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x6f9ed) [0x7f6e17fbb9ed] error.c:1853
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(rb_sys_fail+0x9) [0x7f6e17fbba39] error.c:1901
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/socket.so(+0x6b07) [0x7f6e11290b07] init.c:37
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/socket.so(rsock_getaddrinfo+0x121) [0x7f6e112a8251] raddrinfo.c:364
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/socket.so(rsock_addrinfo+0x3a) [0x7f6e112a8b9a] raddrinfo.c:379
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/socket.so(+0x1239a) [0x7f6e1129c39a] socket.c:1356
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x19ce4f) [0x7f6e180e8e4f] vm_insnhelper.c:1469
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x1aaded) [0x7f6e180f6ded] vm_insnhelper.c:1559
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x1a18fa) [0x7f6e180ed8fa] insns.def:1017
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x1a5d7a) [0x7f6e180f1d7a] vm.c:1201
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x1a64db) [0x7f6e180f24db] vm_eval.c:1251
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x1a6975) [0x7f6e180f2975] vm_eval.c:1292
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x19ce4f) [0x7f6e180e8e4f] vm_insnhelper.c:1469
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x1a18fa) [0x7f6e180ed8fa] insns.def:1017
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x1a5d7a) [0x7f6e180f1d7a] vm.c:1201
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x1aba7f) [0x7f6e180f7a7f] vm.c:648
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(rb_rescue2+0x17e) [0x7f6e17fc105e] eval.c:714
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x19ba9e) [0x7f6e180e7a9e] vm_eval.c:1022
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x19ce4f) [0x7f6e180e8e4f] vm_insnhelper.c:1469
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x1aaded) [0x7f6e180f6ded] vm_insnhelper.c:1559
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x1a188b) [0x7f6e180ed88b] insns.def:1002
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x1a5d7a) [0x7f6e180f1d7a] vm.c:1201
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x1ac403) [0x7f6e180f8403] vm.c:648
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(rb_catch_obj+0xc2) [0x7f6e180ea802] vm_eval.c:1826
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x19e8ae) [0x7f6e180ea8ae] vm_eval.c:1802
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x19ce4f) [0x7f6e180e8e4f] vm_insnhelper.c:1469
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x1aaded) [0x7f6e180f6ded] vm_insnhelper.c:1559
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x1a188b) [0x7f6e180ed88b] insns.def:1002
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x1a5d7a) [0x7f6e180f1d7a] vm.c:1201
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x1ac403) [0x7f6e180f8403] vm.c:648
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(rb_catch_obj+0xc2) [0x7f6e180ea802] vm_eval.c:1826
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x19e8ae) [0x7f6e180ea8ae] vm_eval.c:1802
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x19ce4f) [0x7f6e180e8e4f] vm_insnhelper.c:1469
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x1aaded) [0x7f6e180f6ded] vm_insnhelper.c:1559
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x1a188b) [0x7f6e180ed88b] insns.def:1002
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x1a5d7a) [0x7f6e180f1d7a] vm.c:1201
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(rb_iseq_eval_main+0x25e) [0x7f6e180f935e] vm.c:1449
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(+0x7351a) [0x7f6e17fbf51a] eval.c:250
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(ruby_exec_node+0x1d) [0x7f6e17fc0acd] eval.c:315
/home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0(ruby_run_node+0x1c) [0x7f6e17fc2c2c] eval.c:307
irb(+0xafb) [0x7f6e18604afb]
/lib64/libc.so.6(__libc_start_main+0xf5) [0x7f6e17061c45]
irb(+0xb29) [0x7f6e18604b29]

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

  • Loaded script: irb

  • Loaded features:

    0 enumerator.so
    1 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/enc/encdb.so
    2 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/enc/trans/transdb.so
    3 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/rbconfig.rb
    4 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/compatibility.rb
    5 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/defaults.rb
    6 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/deprecate.rb
    7 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/errors.rb
    8 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/version.rb
    9 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/requirement.rb
    10 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/platform.rb
    11 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb
    12 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/exceptions.rb
    13 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_gem.rb
    14 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/thread.rb
    15 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/monitor.rb
    16 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb
    17 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems.rb
    18 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/e2mmap.rb
    19 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/init.rb
    20 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/workspace.rb
    21 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/inspector.rb
    22 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/context.rb
    23 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/extend-command.rb
    24 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/output-method.rb
    25 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/notifier.rb
    26 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/slex.rb
    27 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/ruby-token.rb
    28 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/ruby-lex.rb
    29 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/src_encoding.rb
    30 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/magic-file.rb
    31 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/readline.so
    32 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/input-method.rb
    33 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/locale.rb
    34 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb.rb
    35 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/path_support.rb
    36 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb
    37 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/completion.rb
    38 /home/developer/.rvm/scripts/irbrc.rb
    39 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/socket.so
    40 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/socket.rb

  • Process memory map:

7f6e10a48000-7f6e10a49000 rw-p 00000000 00:00 0
7f6e10a49000-7f6e10a5e000 r-xp 00000000 fb:00 1712737 /usr/lib64/gcc/x86_64-pc-linux-gnu/4.7.3/libgcc_s.so.1
7f6e10a5e000-7f6e10c5e000 ---p 00015000 fb:00 1712737 /usr/lib64/gcc/x86_64-pc-linux-gnu/4.7.3/libgcc_s.so.1
7f6e10c5e000-7f6e10c5f000 r--p 00015000 fb:00 1712737 /usr/lib64/gcc/x86_64-pc-linux-gnu/4.7.3/libgcc_s.so.1
7f6e10c5f000-7f6e10c60000 rw-p 00016000 fb:00 1712737 /usr/lib64/gcc/x86_64-pc-linux-gnu/4.7.3/libgcc_s.so.1
7f6e10c60000-7f6e10c73000 r-xp 00000000 fb:00 1706784 /lib64/libresolv-2.17.so
7f6e10c73000-7f6e10e73000 ---p 00013000 fb:00 1706784 /lib64/libresolv-2.17.so
7f6e10e73000-7f6e10e74000 r--p 00013000 fb:00 1706784 /lib64/libresolv-2.17.so
7f6e10e74000-7f6e10e75000 rw-p 00014000 fb:00 1706784 /lib64/libresolv-2.17.so
7f6e10e75000-7f6e10e77000 rw-p 00000000 00:00 0
7f6e10e77000-7f6e10e7c000 r-xp 00000000 fb:00 1706771 /lib64/libnss_dns-2.17.so
7f6e10e7c000-7f6e1107b000 ---p 00005000 fb:00 1706771 /lib64/libnss_dns-2.17.so
7f6e1107b000-7f6e1107c000 r--p 00004000 fb:00 1706771 /lib64/libnss_dns-2.17.so
7f6e1107c000-7f6e1107d000 rw-p 00005000 fb:00 1706771 /lib64/libnss_dns-2.17.so
7f6e1107d000-7f6e11089000 r-xp 00000000 fb:00 1706773 /lib64/libnss_files-2.17.so
7f6e11089000-7f6e11288000 ---p 0000c000 fb:00 1706773 /lib64/libnss_files-2.17.so
7f6e11288000-7f6e11289000 r--p 0000b000 fb:00 1706773 /lib64/libnss_files-2.17.so
7f6e11289000-7f6e1128a000 rw-p 0000c000 fb:00 1706773 /lib64/libnss_files-2.17.so
7f6e1128a000-7f6e112b1000 r-xp 00000000 fb:01 15341734 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/socket.so
7f6e112b1000-7f6e114b1000 ---p 00027000 fb:01 15341734 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/socket.so
7f6e114b1000-7f6e114b2000 r--p 00027000 fb:01 15341734 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/socket.so
7f6e114b2000-7f6e114b3000 rw-p 00028000 fb:01 15341734 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/socket.so
7f6e114b3000-7f6e11503000 r-xp 00000000 fb:00 3145830 /lib64/libncurses.so.5.9
7f6e11503000-7f6e11702000 ---p 00050000 fb:00 3145830 /lib64/libncurses.so.5.9
7f6e11702000-7f6e11706000 r--p 0004f000 fb:00 3145830 /lib64/libncurses.so.5.9
7f6e11706000-7f6e11707000 rw-p 00053000 fb:00 3145830 /lib64/libncurses.so.5.9
7f6e11707000-7f6e11708000 rw-p 00000000 00:00 0
7f6e11708000-7f6e11746000 r-xp 00000000 fb:00 1715545 /lib64/libreadline.so.6.2
7f6e11746000-7f6e11945000 ---p 0003e000 fb:00 1715545 /lib64/libreadline.so.6.2
7f6e11945000-7f6e11947000 r--p 0003d000 fb:00 1715545 /lib64/libreadline.so.6.2
7f6e11947000-7f6e1194d000 rw-p 0003f000 fb:00 1715545 /lib64/libreadline.so.6.2
7f6e1194d000-7f6e1194f000 rw-p 00000000 00:00 0
7f6e1194f000-7f6e11957000 r-xp 00000000 fb:01 15340001 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/readline.so
7f6e11957000-7f6e11b56000 ---p 00008000 fb:01 15340001 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/readline.so
7f6e11b56000-7f6e11b57000 r--p 00007000 fb:01 15340001 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/readline.so
7f6e11b57000-7f6e11b58000 rw-p 00008000 fb:01 15340001 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/readline.so
7f6e11b58000-7f6e11b5b000 r-xp 00000000 fb:01 17566110 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/enc/trans/transdb.so
7f6e11b5b000-7f6e11d5a000 ---p 00003000 fb:01 17566110 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/enc/trans/transdb.so
7f6e11d5a000-7f6e11d5b000 r--p 00002000 fb:01 17566110 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/enc/trans/transdb.so
7f6e11d5b000-7f6e11d5c000 rw-p 00003000 fb:01 17566110 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/enc/trans/transdb.so
7f6e11d5c000-7f6e11d5e000 r-xp 00000000 fb:01 17566169 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/enc/encdb.so
7f6e11d5e000-7f6e11f5d000 ---p 00002000 fb:01 17566169 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/enc/encdb.so
7f6e11f5d000-7f6e11f5e000 r--p 00001000 fb:01 17566169 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/enc/encdb.so
7f6e11f5e000-7f6e11f5f000 rw-p 00002000 fb:01 17566169 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/x86_64-linux/enc/encdb.so
7f6e11f5f000-7f6e1703d000 r--p 00000000 fb:00 2622284 /usr/lib64/locale/locale-archive
7f6e1703d000-7f6e171e4000 r-xp 00000000 fb:00 1706622 /lib64/libc-2.17.so
7f6e171e4000-7f6e173e3000 ---p 001a7000 fb:00 1706622 /lib64/libc-2.17.so
7f6e173e3000-7f6e173e7000 r--p 001a6000 fb:00 1706622 /lib64/libc-2.17.so
7f6e173e7000-7f6e173e9000 rw-p 001aa000 fb:00 1706622 /lib64/libc-2.17.so
7f6e173e9000-7f6e173ed000 rw-p 00000000 00:00 0
7f6e173ed000-7f6e174e9000 r-xp 00000000 fb:00 1706726 /lib64/libm-2.17.so
7f6e174e9000-7f6e176e9000 ---p 000fc000 fb:00 1706726 /lib64/libm-2.17.so
7f6e176e9000-7f6e176ea000 r--p 000fc000 fb:00 1706726 /lib64/libm-2.17.so
7f6e176ea000-7f6e176eb000 rw-p 000fd000 fb:00 1706726 /lib64/libm-2.17.so
7f6e176eb000-7f6e176f3000 r-xp 00000000 fb:00 1706662 /lib64/libcrypt-2.17.so
7f6e176f3000-7f6e178f2000 ---p 00008000 fb:00 1706662 /lib64/libcrypt-2.17.so
7f6e178f2000-7f6e178f3000 r--p 00007000 fb:00 1706662 /lib64/libcrypt-2.17.so
7f6e178f3000-7f6e178f4000 rw-p 00008000 fb:00 1706662 /lib64/libcrypt-2.17.so
7f6e178f4000-7f6e17923000 rw-p 00000000 00:00 0
7f6e17923000-7f6e17926000 r-xp 00000000 fb:00 1706721 /lib64/libdl-2.17.so
7f6e17926000-7f6e17b25000 ---p 00003000 fb:00 1706721 /lib64/libdl-2.17.so
7f6e17b25000-7f6e17b26000 r--p 00002000 fb:00 1706721 /lib64/libdl-2.17.so
7f6e17b26000-7f6e17b27000 rw-p 00003000 fb:00 1706721 /lib64/libdl-2.17.so
7f6e17b27000-7f6e17b2e000 r-xp 00000000 fb:00 1706786 /lib64/librt-2.17.so
7f6e17b2e000-7f6e17d2d000 ---p 00007000 fb:00 1706786 /lib64/librt-2.17.so
7f6e17d2d000-7f6e17d2e000 r--p 00006000 fb:00 1706786 /lib64/librt-2.17.so
7f6e17d2e000-7f6e17d2f000 rw-p 00007000 fb:00 1706786 /lib64/librt-2.17.so
7f6e17d2f000-7f6e17d47000 r-xp 00000000 fb:00 1706782 /lib64/libpthread-2.17.so
7f6e17d47000-7f6e17f46000 ---p 00018000 fb:00 1706782 /lib64/libpthread-2.17.so
7f6e17f46000-7f6e17f47000 r--p 00017000 fb:00 1706782 /lib64/libpthread-2.17.so
7f6e17f47000-7f6e17f48000 rw-p 00018000 fb:00 1706782 /lib64/libpthread-2.17.so
7f6e17f48000-7f6e17f4c000 rw-p 00000000 00:00 0
7f6e17f4c000-7f6e181b7000 r-xp 00000000 fb:01 15077566 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0.0
7f6e181b7000-7f6e183b6000 ---p 0026b000 fb:01 15077566 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0.0
7f6e183b6000-7f6e183be000 r--p 0026a000 fb:01 15077566 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0.0
7f6e183be000-7f6e183bf000 rw-p 00272000 fb:01 15077566 /home/developer/.rvm/rubies/ruby-2.0.0-p247/lib/libruby.so.2.0.0
7f6e183bf000-7f6e183e0000 rw-p 00000000 00:00 0
7f6e183e0000-7f6e18402000 r-xp 00000000 fb:00 1706420 /lib64/ld-2.17.so
7f6e184bf000-7f6e185c4000 rw-p 00000000 00:00 0
7f6e185f4000-7f6e185f5000 rw-p 00000000 00:00 0
7f6e185f5000-7f6e185fc000 r--s 00000000 fb:00 2622283 /usr/lib64/gconv/gconv-modules.cache
7f6e185fc000-7f6e185fd000 ---p 00000000 00:00 0
7f6e185fd000-7f6e18601000 rw-p 00000000 00:00 0 [stack:11811]
7f6e18601000-7f6e18602000 r--p 00021000 fb:00 1706420 /lib64/ld-2.17.so
7f6e18602000-7f6e18603000 rw-p 00022000 fb:00 1706420 /lib64/ld-2.17.so
7f6e18603000-7f6e18604000 rw-p 00000000 00:00 0
7f6e18604000-7f6e18605000 r-xp 00000000 fb:01 14945442 /home/developer/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
7f6e18805000-7f6e18806000 r--p 00001000 fb:01 14945442 /home/developer/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
7f6e18806000-7f6e18807000 rw-p 00002000 fb:01 14945442 /home/developer/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
7f6e1939a000-7f6e19bdb000 rw-p 00000000 00:00 0 [heap]
7fffea6d5000-7fffea6f7000 rw-p 00000000 00:00 0 [stack]
7fffea7ff000-7fffea800000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]

[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

Updated by akr (Akira Tanaka) over 11 years ago

2013/7/12 xinjin (Sujin Phil) :

Bug #8627: Socket.pack_sockaddr_in crashes ruby
https://bugs.ruby-lang.org/issues/8627

2.0.0p247 :001 > require 'socket'
=> true
2.0.0p247 :002 > Socket.pack_sockaddr_in(500, "fdgfdgd")
(irb):2: [BUG] rb_sys_fail(getaddrinfo) - errno == 0
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]

It is not reproduced on my environment.

cirrus(07:30:51)% bin/irb
irb(main):001:0> require 'socket'
=> true
irb(main):002:0> Socket.pack_sockaddr_in(500, "fdgfdgd")
SocketError: getaddrinfo: Name or service not known
from (irb):2:in pack_sockaddr_in' from (irb):2 from bin/irb:12:in '
irb(main):003:0> RUBY_VERSION
=> "2.0.0"
irb(main):004:0> RUBY_PATCHLEVEL
=> 247
irb(main):005:0> RUBY_PLATFORM
=> "x86_64-linux"
irb(main):006:0>

Tanaka Akira

Updated by normalperson (Eric Wong) over 11 years ago

"xinjin (Sujin Phil)" wrote:

(({
2.0.0p247 :001 > require 'socket'
=> true
2.0.0p247 :002 > Socket.pack_sockaddr_in(500, "fdgfdgd")
(irb):2: [BUG] rb_sys_fail(getaddrinfo) - errno == 0
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]

I can't reproduce this, either.

It seems errno is getting clobbered somewhere after getaddrinfo
returns EAI_SYSTEM.

Can you also provide an strace? Thanks

Updated by phasis68 (Heesob Park) over 11 years ago

It seems that this issue occurs on Ubuntu 13.04 and already fixed on trunk with the revision r41215

Updated by xinjin (Sujin Phil) over 11 years ago

Seems like this behaviour only happens while running irb
$ uname -a
Linux localhost 3.4.0-sabayon #1 SMP Wed Jul 18 23:06:31 UTC 2012 x86_64 Intel(R) Core(TM)2 Quad CPU Q9550 @ 2.83GHz GenuineIntel GNU/Linux

$ cat test.rb
require 'socket'
Socket.pack_sockaddr_in(500, "fdgfdgd")
$ ruby --version
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
$ ruby test.rb
test.rb:2:in pack_sockaddr_in': No such file or directory - getaddrinfo (Errno::ENOENT) from test.rb:2:in '
Adding the strace as attachment.

Updated by nagachika (Tomoyuki Chikanaga) over 10 years ago

  • Status changed from Open to Closed
  • Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN to 1.9.3: UNKNOWN, 2.0.0: DONE

r41215, r41216 and r41217 were backported to ruby_2_0_0 branch at 44900.

Updated by usa (Usaku NAKAMURA) over 10 years ago

  • Backport changed from 1.9.3: UNKNOWN, 2.0.0: DONE to 1.9.3: DONE, 2.0.0: DONE

I can't test it on the problem platform, but I guess this will occurs with 1.9.3, too.
backported into ruby_1_9_3 at r44933.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0