Project

General

Profile

Actions

Bug #11948

closed

Segfault on blank line in IRB

Added by gerbal (Grant McLendon) almost 9 years ago. Updated over 5 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-linux-musl]
[ruby-core:72704]

Description

Segfault on blank line in IRB

Running in Alpine Linux

bash-4.3# irb
irb(main):001:0> 
irb(main):002:0* 
/usr/lib/ruby/2.2.0/irb/input-method.rb:149: [BUG] Segmentation fault at 0x00000000000010
ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-linux-musl]

-- Control frame information -----------------------------------------------
c:0023 p:---- s:0084 e:000083 CFUNC  :output=
c:0022 p:0031 s:0080 e:000079 METHOD /usr/lib/ruby/2.2.0/irb/input-method.rb:149
c:0021 p:0011 s:0076 e:000075 BLOCK  /usr/lib/ruby/2.2.0/irb.rb:469
c:0020 p:0040 s:0073 e:000072 METHOD /usr/lib/ruby/2.2.0/irb.rb:623
c:0019 p:0009 s:0068 e:000067 BLOCK  /usr/lib/ruby/2.2.0/irb.rb:468 [FINISH]
c:0018 p:---- s:0066 e:000065 CFUNC  :call
c:0017 p:0015 s:0063 e:000062 METHOD /usr/lib/ruby/2.2.0/irb/ruby-lex.rb:188
c:0016 p:0015 s:0059 e:000058 METHOD /usr/lib/ruby/2.2.0/irb/ruby-lex.rb:103
c:0015 p:0022 s:0055 e:000054 METHOD /usr/lib/ruby/2.2.0/irb/slex.rb:205
c:0014 p:0042 s:0047 e:000046 METHOD /usr/lib/ruby/2.2.0/irb/slex.rb:75
c:0013 p:0044 s:0042 e:000041 METHOD /usr/lib/ruby/2.2.0/irb/ruby-lex.rb:282
c:0012 p:0013 s:0038 e:000037 METHOD /usr/lib/ruby/2.2.0/irb/ruby-lex.rb:264
c:0011 p:0022 s:0033 e:000032 BLOCK  /usr/lib/ruby/2.2.0/irb/ruby-lex.rb:235 [FINISH]
c:0010 p:---- s:0030 e:000029 CFUNC  :loop
c:0009 p:0007 s:0027 e:000026 BLOCK  /usr/lib/ruby/2.2.0/irb/ruby-lex.rb:231 [FINISH]
c:0008 p:---- s:0025 e:000024 CFUNC  :catch
c:0007 p:0015 s:0021 e:000020 METHOD /usr/lib/ruby/2.2.0/irb/ruby-lex.rb:230
c:0006 p:0030 s:0018 E:000130 METHOD /usr/lib/ruby/2.2.0/irb.rb:485
c:0005 p:0008 s:0015 e:000014 BLOCK  /usr/lib/ruby/2.2.0/irb.rb:395 [FINISH]
c:0004 p:---- s:0013 e:000012 CFUNC  :catch
c:0003 p:0143 s:0009 E:002570 METHOD /usr/lib/ruby/2.2.0/irb.rb:394
c:0002 p:0021 s:0004 E:000b80 EVAL   /usr/bin/irb:11 [FINISH]
c:0001 p:0000 s:0002 E:000bb0 TOP    [FINISH]

-- Ruby level backtrace information ----------------------------------------
/usr/bin/irb:11:in `<main>'
/usr/lib/ruby/2.2.0/irb.rb:394:in `start'
/usr/lib/ruby/2.2.0/irb.rb:394:in `catch'
/usr/lib/ruby/2.2.0/irb.rb:395:in `block in start'
/usr/lib/ruby/2.2.0/irb.rb:485:in `eval_input'
/usr/lib/ruby/2.2.0/irb/ruby-lex.rb:230:in `each_top_level_statement'
/usr/lib/ruby/2.2.0/irb/ruby-lex.rb:230:in `catch'
/usr/lib/ruby/2.2.0/irb/ruby-lex.rb:231:in `block in each_top_level_statement'
/usr/lib/ruby/2.2.0/irb/ruby-lex.rb:231:in `loop'
/usr/lib/ruby/2.2.0/irb/ruby-lex.rb:235:in `block (2 levels) in each_top_level_statement'
/usr/lib/ruby/2.2.0/irb/ruby-lex.rb:264:in `lex'
/usr/lib/ruby/2.2.0/irb/ruby-lex.rb:282:in `token'
/usr/lib/ruby/2.2.0/irb/slex.rb:75:in `match'
/usr/lib/ruby/2.2.0/irb/slex.rb:205:in `match_io'
/usr/lib/ruby/2.2.0/irb/ruby-lex.rb:103:in `getc'
/usr/lib/ruby/2.2.0/irb/ruby-lex.rb:188:in `buf_input'
/usr/lib/ruby/2.2.0/irb/ruby-lex.rb:188:in `call'
/usr/lib/ruby/2.2.0/irb.rb:468:in `block in eval_input'
/usr/lib/ruby/2.2.0/irb.rb:623:in `signal_status'
/usr/lib/ruby/2.2.0/irb.rb:469:in `block (2 levels) in eval_input'
/usr/lib/ruby/2.2.0/irb/input-method.rb:149:in `gets'
/usr/lib/ruby/2.2.0/irb/input-method.rb:149:in `output='

-- Machine register context ------------------------------------------------
 RIP: 0x00007f4657beb59a RBP: 0x0000000000000500 RSP: 0x00007ffff9166db8
 RAX: 0x0000000000000000 RBX: 0x0000000000000300 RCX: 0x00007f4657e4e220
 RDX: 0x000055bbc790df10 RDI: 0x000055bbc7a08f30 RSI: 0x0000000000000020
  R8: 0x0000000000000300  R9: 0x00007f4657d4b2c0 R10: 0x00007f4657e4a940
 R11: 0x0000000000000246 R12: 0x000055bbc7a08f30 R13: 0x00007f4657e4e520
 R14: 0x00007f4657e4e528 R15: 0x00007f4657e4e52c EFL: 0x0000000000010287

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

* Loaded script: irb

* Loaded features:

    0 enumerator.so
    1 rational.so
    2 complex.so
    3 /usr/lib/ruby/2.2.0/x86_64-linux-musl/enc/encdb.so
    4 /usr/lib/ruby/2.2.0/x86_64-linux-musl/enc/trans/transdb.so
    5 /usr/lib/ruby/2.2.0/unicode_normalize.rb
    6 /usr/lib/ruby/2.2.0/x86_64-linux-musl/rbconfig.rb
    7 thread.rb
    8 /usr/lib/ruby/2.2.0/x86_64-linux-musl/thread.so
    9 /usr/local/lib/site_ruby/2.2.0/rubygems/compatibility.rb
   10 /usr/local/lib/site_ruby/2.2.0/rubygems/defaults.rb
   11 /usr/local/lib/site_ruby/2.2.0/rubygems/deprecate.rb
   12 /usr/local/lib/site_ruby/2.2.0/rubygems/errors.rb
   13 /usr/local/lib/site_ruby/2.2.0/rubygems/version.rb
   14 /usr/local/lib/site_ruby/2.2.0/rubygems/requirement.rb
   15 /usr/local/lib/site_ruby/2.2.0/rubygems/platform.rb
   16 /usr/local/lib/site_ruby/2.2.0/rubygems/basic_specification.rb
   17 /usr/local/lib/site_ruby/2.2.0/rubygems/stub_specification.rb
   18 /usr/local/lib/site_ruby/2.2.0/rubygems/util/list.rb
   19 /usr/lib/ruby/2.2.0/x86_64-linux-musl/stringio.so
   20 /usr/local/lib/site_ruby/2.2.0/rubygems/specification.rb
   21 /usr/local/lib/site_ruby/2.2.0/rubygems/exceptions.rb
   22 /usr/local/lib/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb
   23 /usr/lib/ruby/2.2.0/monitor.rb
   24 /usr/local/lib/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb
   25 /usr/local/lib/site_ruby/2.2.0/rubygems.rb
   26 /usr/lib/ruby/2.2.0/e2mmap.rb
   27 /usr/lib/ruby/2.2.0/irb/init.rb
   28 /usr/lib/ruby/2.2.0/irb/workspace.rb
   29 /usr/lib/ruby/2.2.0/irb/inspector.rb
   30 /usr/lib/ruby/2.2.0/irb/context.rb
   31 /usr/lib/ruby/2.2.0/irb/extend-command.rb
   32 /usr/lib/ruby/2.2.0/irb/output-method.rb
   33 /usr/lib/ruby/2.2.0/irb/notifier.rb
   34 /usr/lib/ruby/2.2.0/irb/slex.rb
   35 /usr/lib/ruby/2.2.0/irb/ruby-token.rb
   36 /usr/lib/ruby/2.2.0/irb/ruby-lex.rb
   37 /usr/lib/ruby/2.2.0/irb/src_encoding.rb
   38 /usr/lib/ruby/2.2.0/irb/magic-file.rb
   39 /usr/lib/ruby/2.2.0/x86_64-linux-musl/readline.so
   40 /usr/lib/ruby/2.2.0/irb/input-method.rb
   41 /usr/lib/ruby/2.2.0/irb/locale.rb
   42 /usr/lib/ruby/2.2.0/irb.rb

* Process memory map:

55bbc6e5d000-55bbc6e5e000 r-xp 00000000 fc:05 394070                     /usr/bin/ruby
55bbc705d000-55bbc705e000 r--p 00000000 fc:05 394070                     /usr/bin/ruby
55bbc705e000-55bbc705f000 rw-p 00001000 fc:05 394070                     /usr/bin/ruby
55bbc73b3000-55bbc7a0b000 rw-p 00000000 00:00 0                          [heap]
7f46566c3000-7f4656912000 r-xp 00000000 fc:05 394093                     /usr/lib/libncursesw.so.6.0
7f4656912000-7f4656917000 r--p 0004f000 fc:05 394093                     /usr/lib/libncursesw.so.6.0
7f4656917000-7f4656918000 rw-p 00054000 fc:05 394093                     /usr/lib/libncursesw.so.6.0
7f4656918000-7f4656b3d000 r-xp 00000000 fc:05 394075                     /usr/lib/libedit.so.0.0.53
7f4656b3d000-7f4656b40000 r--p 00025000 fc:05 394075                     /usr/lib/libedit.so.0.0.53
7f4656b40000-7f4656b41000 rw-p 00028000 fc:05 394075                     /usr/lib/libedit.so.0.0.53
7f4656b41000-7f4656b44000 rw-p 00000000 00:00 0 
7f4656b44000-7f4656d49000 r-xp 00000000 fc:05 394798                     /usr/lib/ruby/2.2.0/x86_64-linux-musl/readline.so
7f4656d49000-7f4656d4a000 r--p 00005000 fc:05 394798                     /usr/lib/ruby/2.2.0/x86_64-linux-musl/readline.so
7f4656d4a000-7f4656d4b000 rw-p 00006000 fc:05 394798                     /usr/lib/ruby/2.2.0/x86_64-linux-musl/readline.so
7f4656d4b000-7f4656f51000 r-xp 00000000 fc:05 394802                     /usr/lib/ruby/2.2.0/x86_64-linux-musl/stringio.so
7f4656f51000-7f4656f52000 r--p 00006000 fc:05 394802                     /usr/lib/ruby/2.2.0/x86_64-linux-musl/stringio.so
7f4656f52000-7f4656f53000 rw-p 00007000 fc:05 394802                     /usr/lib/ruby/2.2.0/x86_64-linux-musl/stringio.so
7f4656f53000-7f4657155000 r-xp 00000000 fc:05 394805                     /usr/lib/ruby/2.2.0/x86_64-linux-musl/thread.so
7f4657155000-7f4657156000 r--p 00002000 fc:05 394805                     /usr/lib/ruby/2.2.0/x86_64-linux-musl/thread.so
7f4657156000-7f4657157000 rw-p 00003000 fc:05 394805                     /usr/lib/ruby/2.2.0/x86_64-linux-musl/thread.so
7f4657157000-7f4657359000 r-xp 00000000 fc:05 394766                     /usr/lib/ruby/2.2.0/x86_64-linux-musl/enc/trans/transdb.so
7f4657359000-7f465735a000 r--p 00002000 fc:05 394766                     /usr/lib/ruby/2.2.0/x86_64-linux-musl/enc/trans/transdb.so
7f465735a000-7f465735b000 rw-p 00003000 fc:05 394766                     /usr/lib/ruby/2.2.0/x86_64-linux-musl/enc/trans/transdb.so
7f465735b000-7f465755c000 r-xp 00000000 fc:05 394724                     /usr/lib/ruby/2.2.0/x86_64-linux-musl/enc/encdb.so
7f465755c000-7f465755d000 r--p 00001000 fc:05 394724                     /usr/lib/ruby/2.2.0/x86_64-linux-musl/enc/encdb.so
7f465755d000-7f465755e000 rw-p 00002000 fc:05 394724                     /usr/lib/ruby/2.2.0/x86_64-linux-musl/enc/encdb.so
7f465755e000-7f46577bf000 r-xp 00000000 fc:05 394087                     /usr/lib/libgmp.so.10.3.0
7f46577bf000-7f46577c1000 r--p 00061000 fc:05 394087                     /usr/lib/libgmp.so.10.3.0
7f46577c1000-7f46577c2000 rw-p 00063000 fc:05 394087                     /usr/lib/libgmp.so.10.3.0
7f46577c2000-7f4657bae000 r-xp 00000000 fc:05 394105                     /usr/lib/libruby.so.2.2.0
7f4657bae000-7f4657bb6000 r--p 001ec000 fc:05 394105                     /usr/lib/libruby.so.2.2.0
7f4657bb6000-7f4657bb7000 rw-p 001f4000 fc:05 394105                     /usr/lib/libruby.so.2.2.0
7f4657bb7000-7f4657bc5000 rw-p 00000000 00:00 0 
7f4657bc5000-7f4657c4c000 r-xp 00000000 fc:05 393371                     /lib/ld-musl-x86_64.so.1
7f4657d44000-7f4657d45000 r--s 00000000 fc:05 393323                     /etc/localtime
7f4657d45000-7f4657d46000 ---p 00000000 00:00 0 
7f4657d46000-7f4657e4c000 rw-p 00000000 00:00 0                          [stack:78]
7f4657e4c000-7f4657e4d000 r--p 00087000 fc:05 393371                     /lib/ld-musl-x86_64.so.1
7f4657e4d000-7f4657e4e000 rw-p 00088000 fc:05 393371                     /lib/ld-musl-x86_64.so.1
7f4657e4e000-7f4657e51000 rw-p 00000000 00:00 0 
7ffff914b000-7ffff916e000 rw-p 00000000 00:00 0 
7ffff91db000-7ffff91dd000 r--p 00000000 00:00 0                          [vvar]
7ffff91dd000-7ffff91df000 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

Aborted (core dumped)

Updated by hugopeixoto (Hugo Peixoto) over 6 years ago

I was unable to reproduce this with alpine 3.7 in docker, with ruby 2.4.3p205:

$ docker run --rm -ti alpine:3.7
/ # apk update && apk add ruby-irb
...
/ # ruby -v
ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux-musl]
/ # irb
irb(main):001:0>
irb(main):002:0*
irb(main):003:0*

Updated by hsbt (Hiroshi SHIBATA) over 5 years ago

  • Status changed from Open to Rejected

I was also unable to reproduce.

~ >  docker run --rm -ti alpine
/ # apk update
/ # apk add ruby-irb
/ # ruby -v
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux-musl]
Actions

Also available in: Atom PDF

Like0
Like0Like0