[BUG:1.9] irb/xmp with empty input aborts


#1

Yuguie$B$G$9!#<!$N$h$&$K$9$k$He(B[BUG]e$B$,=P$^$9!#e(B

% ruby-1.9.1 -rirb/xmp < /dev/null
/Users/yugui/local/lib/ruby-1.9.1/1.9.1/irb/extend-command.rb:210: [BUG]
get_local_var_idx: -1
ruby 1.9.1p0 (2009-01-16 revision 21600) [i386-darwin9.6.0]

– control frame ----------
c:0019 p:---- s:0052 b:0052 l:000051 d:000051 CFUNC :module_eval
c:0018 p:0041 s:0048 b:0048 l:000047 d:000047 METHOD
/Users/yugui/local/lib/ruby-1.9.1/1.9.1/irb/extend-command.rb:210
c:0017 p:0016 s:0042 b:0042 l:000033 d:000041 BLOCK
/Users/yugui/local/lib/ruby-1.9.1/1.9.1/irb/extend-command.rb:205
c:0016 p:---- s:0039 b:0039 l:000038 d:000038 FINISH
c:0015 p:---- s:0037 b:0037 l:000036 d:000036 CFUNC :each
c:0014 p:0012 s:0034 b:0034 l:000033 d:000033 METHOD
/Users/yugui/local/lib/ruby-1.9.1/1.9.1/irb/extend-command.rb:204
c:0013 p:0098 s:0030 b:0030 l:000029 d:000029 CLASS
/Users/yugui/local/lib/ruby-1.9.1/1.9.1/irb/extend-command.rb:222
c:0012 p:0021 s:0028 b:0028 l:000027 d:000027 CLASS
/Users/yugui/local/lib/ruby-1.9.1/1.9.1/irb/extend-command.rb:192
c:0011 p:0009 s:0026 b:0026 l:000025 d:000025 TOP
/Users/yugui/local/lib/ruby-1.9.1/1.9.1/irb/extend-command.rb:11
c:0010 p:---- s:0024 b:0024 l:000023 d:000023 FINISH
c:0009 p:---- s:0022 b:0022 l:000021 d:000021 CFUNC :require
c:0008 p:0047 s:0018 b:0018 l:000017 d:000017 TOP
/Users/yugui/local/lib/ruby-1.9.1/1.9.1/irb.rb:15
c:0007 p:---- s:0016 b:0016 l:000015 d:000015 FINISH
c:0006 p:---- s:0014 b:0014 l:000013 d:000013 CFUNC :require
c:0005 p:0011 s:0010 b:0010 l:000009 d:000009 TOP
/Users/yugui/local/lib/ruby-1.9.1/1.9.1/irb/xmp.rb:12
c:0004 p:---- s:0008 b:0008 l:000007 d:000007 FINISH
c:0003 p:---- s:0006 b:0006 l:000005 d:000005 CFUNC :require
c:0002 p:-587640 s:0004 b:0004 l:000003 d:000003 TOP
c:0001 p:0000 s:0002 b:0002 l:002634 d:002634 TOP :38964

– Ruby level backtrace
information-----------------------------------------
/Users/yugui/local/lib/ruby-1.9.1/1.9.1/irb/extend-command.rb:210:in
module_eval' /Users/yugui/local/lib/ruby-1.9.1/1.9.1/irb/extend-command.rb:210:indef_extend_command’
/Users/yugui/local/lib/ruby-1.9.1/1.9.1/irb/extend-command.rb:205:in
block in install_extend_commands' /Users/yugui/local/lib/ruby-1.9.1/1.9.1/irb/extend-command.rb:204:ineach’
/Users/yugui/local/lib/ruby-1.9.1/1.9.1/irb/extend-command.rb:204:in
install_extend_commands' /Users/yugui/local/lib/ruby-1.9.1/1.9.1/irb/extend-command.rb:222:inmodule:ContextExtender
/Users/yugui/local/lib/ruby-1.9.1/1.9.1/irb/extend-command.rb:192:in
<module:IRB>' /Users/yugui/local/lib/ruby-1.9.1/1.9.1/irb/extend-command.rb:11:in<top (required)>’
/Users/yugui/local/lib/ruby-1.9.1/1.9.1/irb.rb:15:in require' /Users/yugui/local/lib/ruby-1.9.1/1.9.1/irb.rb:15:in<top (required)>’
/Users/yugui/local/lib/ruby-1.9.1/1.9.1/irb/xmp.rb:12:in require' /Users/yugui/local/lib/ruby-1.9.1/1.9.1/irb/xmp.rb:12:in<top
(required)>’
ruby-1.9.1:0:in `require’

– C level backtrace information

0x116522 0 ruby-1.9.1 0x00116522
rb_vm_bugreport + 82
0x2baec 1 ruby-1.9.1 0x0002baec rb_warning +
444
0x2bb4b 2 ruby-1.9.1 0x0002bb4b rb_bug + 43
0xf0841 3 ruby-1.9.1 0x000f0841
ruby_iseq_translate_threaded_code + 1345
0xf38a4 4 ruby-1.9.1 0x000f38a4
rb_parse_in_main + 6356
0xfa842 5 ruby-1.9.1 0x000fa842
ruby_iseq_compile + 994
0xfe15b 6 ruby-1.9.1 0x000fe15b
ruby_debug_breakpoint + 3579
0xf072e 7 ruby-1.9.1 0x000f072e
ruby_iseq_translate_threaded_code + 1070
0xf86f2 8 ruby-1.9.1 0x000f86f2
rb_parse_in_main + 26402
0xf23ad 9 ruby-1.9.1 0x000f23ad
rb_parse_in_main + 989
0xfa8dc 10 ruby-1.9.1 0x000fa8dc
ruby_iseq_compile + 1148
0xfe15b 11 ruby-1.9.1 0x000fe15b
ruby_debug_breakpoint + 3579
0x1017b7 12 ruby-1.9.1 0x001017b7
rb_iseq_compile_with_option + 183
0x101937 13 ruby-1.9.1 0x00101937
rb_iseq_compile + 39
0x10ebba 14 ruby-1.9.1 0x0010ebba
vm_invoke_proc + 1562
0x1123cb 15 ruby-1.9.1 0x001123cb
rb_mod_module_exec + 283
0x101d75 16 ruby-1.9.1 0x00101d75
rb_iseq_compile + 1125
0x10669d 17 ruby-1.9.1 0x0010669d rb_funcall2

  • 1773
    0x108e0b 18 ruby-1.9.1 0x00108e0b rb_funcall2
  • 11867
    0x10e1fb 19 ruby-1.9.1 0x0010e1fb rb_funcall2
  • 33355
    0x1117c6 20 ruby-1.9.1 0x001117c6 rb_yield +
    486
    0x6452 21 ruby-1.9.1 0x00006452 rb_ary_each +
    66
    0x10669d 22 ruby-1.9.1 0x0010669d rb_funcall2
  • 1773
    0x108e0b 23 ruby-1.9.1 0x00108e0b rb_funcall2
  • 11867
    0x10e1fb 24 ruby-1.9.1 0x0010e1fb rb_funcall2
  • 33355
    0x10e538 25 ruby-1.9.1 0x0010e538 rb_iseq_eval
  • 264
    0x324b9 26 ruby-1.9.1 0x000324b9 rb_load + 345
    0x32a3a 27 ruby-1.9.1 0x00032a3a
    rb_require_safe + 890
    0x10669d 28 ruby-1.9.1 0x0010669d rb_funcall2
  • 1773
    0x108e0b 29 ruby-1.9.1 0x00108e0b rb_funcall2
  • 11867
    0x10e1fb 30 ruby-1.9.1 0x0010e1fb rb_funcall2
  • 33355
    0x10e538 31 ruby-1.9.1 0x0010e538 rb_iseq_eval
  • 264
    0x324b9 32 ruby-1.9.1 0x000324b9 rb_load + 345
    0x32a3a 33 ruby-1.9.1 0x00032a3a
    rb_require_safe + 890
    0x10669d 34 ruby-1.9.1 0x0010669d rb_funcall2
  • 1773
    0x108e0b 35 ruby-1.9.1 0x00108e0b rb_funcall2
  • 11867
    0x10e1fb 36 ruby-1.9.1 0x0010e1fb rb_funcall2
  • 33355
    0x10e538 37 ruby-1.9.1 0x0010e538 rb_iseq_eval
  • 264
    0x324b9 38 ruby-1.9.1 0x000324b9 rb_load + 345
    0x32a3a 39 ruby-1.9.1 0x00032a3a
    rb_require_safe + 890
    0x10f3c9 40 ruby-1.9.1 0x0010f3c9 rb_f_eval +
    697
    0x1060cb 41 ruby-1.9.1 0x001060cb rb_funcall2
  • 283
    0xb8a42 42 ruby-1.9.1 0x000b8a42
    ruby_init_loadpath + 258
    0xbace2 43 ruby-1.9.1 0x000bace2
    ruby_init_loadpath + 9122
    0x2f3f9 44 ruby-1.9.1 0x0002f3f9 rb_ensure +
    121
    0xbaffd 45 ruby-1.9.1 0x000baffd
    ruby_init_loadpath + 9917
    0xbb9dc 46 ruby-1.9.1 0x000bb9dc ruby_set_argv
  • 1420
    0x1059cf 47 ruby-1.9.1 0x001059cf
    rb_vm_call_cfunc + 175
    0xbbf66 48 ruby-1.9.1 0x000bbf66
    ruby_process_options + 166
    0x30e5b 49 ruby-1.9.1 0x00030e5b ruby_options
  • 123
    0x1c57 50 ruby-1.9.1 0x00001c57 main + 87
    0x1bc6 51 ruby-1.9.1 0x00001bc6 start + 54

[NOTE]
You may encounter a bug of Ruby interpreter. Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html


#2

e$B%A%1%C%He(B #1021 e$B$,99?7$5$l$^$7$?!#e(B (by Koichi Sasada)

e$B%9%F!<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

Applied in changeset r21661.

http://redmine.ruby-lang.org/issues/show/1021