[Bug:1.9] test_dup(TestIO) may cause infinite loop

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

test_dup(TestIO)e$B$GL58B%k!<%W$K$J$C$F$7$^$&$3$H$,$"$k$h$&$G$9!#e(B

stracee$B$7$F$_$?$H$3$m!"e(B1e$B$DL$Ne(Bdupe$B$GNc30$K$J$i$J$+$C$?>l9g!"e(B
e$B=PMh$?e(BIOe$B$,e(B2e$B$DL$Ne(Bdupe$B$NCf$Ge(BGCe$B$5$l$F!“e(B2e$B$DL$Ne(Bdupe$B$G=PMh$?e(BIOe$B$,e(B
1e$B$DL$Ne(Bdupe$B$Ge(BGCe$B$5$l$F!”$H$$$&$O$^$jJ}$K8+$($^$9!#e(B

Index: test/ruby/test_io.rb

— test/ruby/test_io.rb (revision 19381)
+++ test/ruby/test_io.rb (working copy)
@@ -633,7 +633,7 @@
loop {a << IO.pipe}
end
assert_raise(Errno::EMFILE, Errno::ENFILE, Errno::ENOMEM) do

  •  loop {a[-1][0].dup; a[-1][1].dup}
    
  •  loop {a << [a[-1][0].dup, a[-1][1].dup]}
    
    end
    a.each do |r, w|
    r.close unless !r || r.closed?

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

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

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