[Bug:1.9] irb fg

e$B@>;3OB9-$G$9!#e(B

fge$B$K0z?t$r;XDj$7$J$+$C$?$je(Bjobse$B$K$J$$?tCM$r;XDj$9$k$He(B
e$B!Ve(BMaybe IRB bug!!e$B!W$K$J$j$^$9!#e(B

e$B!Ve(BMaybe IRB bug!!e$B!W$NA0$K2~9T$,$J$$$N$bJQ$J5$$,$7$^$9!#e(B

% irb-trunk -r irb/completion --simple-prompt

RUBY_DESCRIPTION
=> “ruby 1.9.0 (2008-06-12 revision 17105) [i686-linux]”

fg
ArgumentError: wrong number of arguments (0 for 1)
from
/home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb/cmd/nop.rb:19:in execute' from (eval):3:inirb_fg’
from (eval):9:in irb_fg' from (irb):2:inirb_binding’
from
/home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb/workspace.rb:80:in ev al' from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb/workspace.rb:80:inevaluate’
from
/home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb/context.rb:218:in
evaluate' from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb.rb:149:inblock (2 levels) in eval_input’
from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb.rb:263:in
signal_status' from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb.rb:146:inblock in eval_input’
from
/home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb/ruby-lex.rb:243:in block (2 levels) in each_top_level_statement' from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb/ruby-lex.rb:230:inloop’
from
/home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb/ruby-lex.rb:230:in block in each_top_level_statement' from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb/ruby-lex.rb:229:incatch’
from
/home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb/ruby-lex.rb:229:in
each_top_level_statement' from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb.rb:145:ineval_input’
from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb.rb:69:in
block in start' from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb.rb:68:incatch’
from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb.rb:68:in
start' from /home/kazu/opt/ruby-trunk/bin/irb-trunk:12:in'Maybe
IRB bug!!

jobs
=> #0->irb on main (#Thread:0x805c1cc: running)

fg 1
NoMethodError: undefined method alive?' for nil:NilClass from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb/ext/multi-irb.rb:55:inswitch’
from
/home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb/cmd/subirb.rb:32:in
execute' from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb/cmd/nop.rb:19:inexecute’
from (eval):3:in irb_fg' from (eval):9:inirb_fg’
from (irb):4:in irb_binding' from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb/workspace.rb:80:ineval’
from
/home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb/workspace.rb:80:in
evaluate' from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb/context.rb:218:inevaluate’
from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb.rb:149:in
block (2 levels) in eval_input' from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb.rb:263:insignal_status’
from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb.rb:146:in
block in eval_input' from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb/ruby-lex.rb:243:inblock
(2 levels) in each_top_level_statement’
from
/home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb/ruby-lex.rb:230:in loop' from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb/ruby-lex.rb:230:inblock
in each_top_level_statement’
from
/home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb/ruby-lex.rb:229:in catch' from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb/ruby-lex.rb:229:ineach_top_level_statement’
from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb.rb:145:in
eval_input' from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb.rb:69:inblock in start’
from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb.rb:68:in
catch' from /home/kazu/opt/ruby-trunk/lib/ruby/1.9.0/irb.rb:68:instart’
from /home/kazu/opt/ruby-trunk/bin/irb-trunk:12:in `'Maybe
IRB bug!!

e$B@>;3OB9-$G$9!#e(B

At Thu, 12 Jun 2008 17:14:00 +0900,
Kazuhiro NISHIYAMA wrote:

fge$B$K0z?t$r;XDj$7$J$+$C$?$je(Bjobse$B$K$J$$?tCM$r;XDj$9$k$He(B
e$B!Ve(BMaybe IRB bug!!e$B!W$K$J$j$^$9!#e(B

1.8, 1.8.7, 1.8.6, 1.8.5e$B$G$bF1MM$G$9!#e(B

% irb18 -r irb/completion --simple-prompt

RUBY_DESCRIPTION
=> “ruby 1.8.7 (2008-06-12 patchlevel 5000) [i686-linux]”

fg
ArgumentError: wrong number of arguments (0 for 1)
from /home/kazu/opt/ruby18/lib/ruby/1.8/irb/cmd/nop.rb:20:in
execute' from /home/kazu/opt/ruby18/lib/ruby/1.8/irb/cmd/nop.rb:20:inexecute’
from (eval):3:in irb_fg' from (eval):9:insend’
from (eval):9:in fg' from (irb):2:inirb_binding’
from /home/kazu/opt/ruby18/lib/ruby/1.8/irb/workspace.rb:52:in
`irb_binding’
from /home/kazu/opt/ruby18/lib/ruby/1.8/irb/workspace.rb:52
Maybe IRB bug!!

jobs
=> #0->irb on main (#Thread:0xb7c841ac: running)

fg 1
NoMethodError: undefined method alive?' for nil:NilClass from /home/kazu/opt/ruby18/lib/ruby/1.8/irb/ext/multi-irb.rb:56:inswitch’
from /home/kazu/opt/ruby18/lib/ruby/1.8/irb/cmd/subirb.rb:33:in
execute' from /home/kazu/opt/ruby18/lib/ruby/1.8/irb/cmd/nop.rb:20:inexecute’
from (eval):3:in irb_fg' from (eval):9:insend’
from (eval):9:in fg' from (irb):4:inirb_binding’
from /home/kazu/opt/ruby18/lib/ruby/1.8/irb/workspace.rb:52:in
`irb_binding’
from /home/kazu/opt/ruby18/lib/ruby/1.8/irb/workspace.rb:52
Maybe IRB bug!!

e$B$1$$$8$e!w$$$7$D$+$G$9e(B.

In [ruby-dev :35075 ] the message: "[ruby-dev:35075]
[Bug:1.8][Bug:1.8.7] irb fg ", on Jun/12 17:26(JST) Kazuhiro NISHIYAMA
writes:

e$B@>;3OB9-$G$9!#e(B

fge$B$K0z?t$r;XDj$7$J$+$C$?$je(Bjobse$B$K$J$$?tCM$r;XDj$9$k$He(B
e$B!Ve(BMaybe IRB bug!!e$B!W$K$J$j$^$9!#e(B

1.8, 1.8.7, 1.8.6, 1.8.5e$B$G$bF1MM$G$9!#e(B

irbe$B4XO"%3%^%s%I$O%(%i!<=hM}$N$3$H$"$^$j9M$($F$J$$$G$9$M$'e(B…
e$B$A$g$C$H9M$($F$_$^$9e(B.

__
---------------------------------------------------->> e$B@PDMe(B
e$B7=<ye(B <<—
---------------------------------->> e-mail: [email protected] <<—

e$B1sF#$G$9!#e(B

2008/06/13 12:04 e$B@PDM7=<ye(B [email protected]:

fge$B$K0z?t$r;XDj$7$J$+$C$?$je(Bjobse$B$K$J$$?tCM$r;XDj$9$k$He(B
e$B!Ve(BMaybe IRB bug!!e$B!W$K$J$j$^$9!#e(B

1.8, 1.8.7, 1.8.6, 1.8.5e$B$G$bF1MM$G$9!#e(B

irbe$B4XO"%3%^%s%I$O%(%i!<=hM}$N$3$H$"$^$j9M$($F$J$$$G$9$M$'e(B…
e$B$A$g$C$H9M$($F$_$^$9e(B.

e$B$H$j$"$($:$3$NLdBj$N%Q%C%A$@$1=q$$$F$_$^$7$?!#e(B
e$B$I$&$G$7$g$&$+!#e(B

Index: lib/irb/ext/multi-irb.rb

— lib/irb/ext/multi-irb.rb (revision 18754)
+++ lib/irb/ext/multi-irb.rb (working copy)
@@ -69,7 +69,7 @@
end

 def search(key)
  •  case key
    
  •  job = case key
     when Integer
    
    @jobs[key]
    when Irb
    @@ -77,10 +77,10 @@
    when Thread
    @jobs.assoc(key)
    else
  • assoc = @jobs.find{|k, v| v.context.main.equal?(key)}
  • IRB.fail NoSuchJob, key if assoc.nil?
  • assoc
  • @jobs.find{|k, v| v.context.main.equal?(key)}
    end

  •  IRB.fail NoSuchJob, key if job.nil?
    
  •  job
    

    end

    def delete(key)
    Index: lib/irb/extend-command.rb
    ===================================================================
    — lib/irb/extend-command.rb (revision 18754)
    +++ lib/irb/extend-command.rb (working copy)
    @@ -125,9 +125,14 @@
    eval %[
    def #{cmd_name}(*opts, &b)
    require “#{load_file}”

  •  arity = 
    

ExtendCommand::#{cmd_class}.instance_method(:execute).arity

  •  args = (1..arity.abs).map {|i| "arg" + i.to_s }
    
  •  args << "*opts" if arity < 0
    
  •  args << "&block"
    
  •  args = args.join(", ")
     eval %[
    
  •    def #{cmd_name}(*opts, &b)
    
  • ExtendCommand::#{cmd_class}.execute(irb_context, *opts, &b)
  •    def #{cmd_name}(\#{args})
    
  • ExtendCommand::#{cmd_class}.execute(irb_context, #{args})
    end
    ]
    send :#{cmd_name}, *opts, &b

e$B$1$$$8$e!w$$$7$D$+$G$9e(B.

In [ruby-dev :35902 ] the message: "[ruby-dev:35902] Re:
[Bug:1.8][Bug:1.8.7] irb fg ", on Aug/21 22:06(JST) “Yusuke ENDOH”
writes:

e$B1sF#$G$9!#e(B

irbe$B4XO"%3%^%s%I$O%(%i!<=hM}$N$3$H$"$^$j9M$($F$J$$$G$9$M$'e(B…
e$B$A$g$C$H9M$($F$_$^$9e(B.

e$B$H$j$"$($:$3$NLdBj$N%Q%C%A$@$1=q$$$F$_$^$7$?!#e(B
e$B$I$&$G$7$g$&$+!#e(B

e$B%Q%C%A$"$j$,$H$&$4$6$$$^$9e(B.

e$B%A%’%C%/%$%s$G$-$k$s$G$7$?$C$1e(B?
e$B$G$-$k$J$i$*4j$$$7$?$$$N$G$9$,e(B?

__
---------------------------------------------------->> e$B@PDMe(B
e$B7=<ye(B <<—
---------------------------------->> e-mail: [email protected] <<—

e$B%A%1%C%He(B #144 e$B$,99?7$5$l$^$7$?!#e(B (by Yusuke E.)

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 r18837.

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

e$B%A%1%C%He(B #145 e$B$,99?7$5$l$^$7$?!#e(B (by Shyouhei U.)

e$BC4Ev<Te(B Akinori MUSHAe$B$K%;%C%He(B

trunke$B$G$O$9$G$K=$@5:Q$_$N$h$&$G$9!#e(B

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

e$B%A%1%C%He(B #145 e$B$,99?7$5$l$^$7$?!#e(B (by Shyouhei U.)

e$B%9%F!<%?%9e(B Closede$B$+$ie(BOpene$B$KJQ99e(B
e$BC4Ev<Te(B Akinori MUSHAe$B$+$ie(BKirk H.e$B$KJQ99e(B

1.8.6 also has this issue.

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

e$B%A%1%C%He(B #145 e$B$,99?7$5$l$^$7$?!#e(B (by Marc-Andre L.)

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 r24911.

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

e$B%A%1%C%He(B #145 e$B$,99?7$5$l$^$7$?!#e(B (by Kirk H.)

e$B%9%F!<%?%9e(B Assignede$B$+$ie(BClosede$B$KJQ99e(B

This issue was solved with changeset r27934.
, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


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