Package: ruby
Version: 4.2
Severity: normal
The attached code fails after about 100 iterations of invoking popen.
However, on this particular interpreter version inserting a comment into
the code makes it not fail.
On stable the code fails regardless of comment.
-- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.25-2-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages ruby depends on:
ii ruby1.8 1.8.7.22-3 Interpreter of object-oriented scr
ruby recommends no packages.
ruby suggests no packages.
-- debconf-show failed
def try_analyze *words
analyzer = IO.popen( 'cat', IO::RDWR )
res = []
t = Thread.new( (IO::for_fd analyzer.fileno),res){|fd,ary|
#comment
while l = fd.gets do
STDERR.putc 8
ary.push l
end
fd.close rescue nil # hopefully prevents zombie hordes
}
words.each{|w|
STDERR.putc '.'[0]
analyzer.puts w
}
analyzer.close_write rescue nil
t.join
end
1.upto(1000){|_|
try_analyze *%w(a b c d e f g h i)
STDERR.puts _
}