[MacRuby] #1457: Errno::EBADF occurs when use IO within Thread
MacRuby
ruby-noreply at macosforge.org
Sun Feb 12 21:58:01 PST 2012
#1457: Errno::EBADF occurs when use IO within Thread
----------------------------------+-----------------------------------------
Reporter: watson1978@… | Owner: lsansonetti@…
Type: defect | Status: new
Priority: blocker | Milestone:
Component: MacRuby | Keywords:
----------------------------------+-----------------------------------------
Test Script:
{{{
Thread.start do
loop do
begin
fd = IO.sysopen("/tmp/aaa.txt", "a")
io = IO.for_fd(fd)
io.write("aaaa")
GC.start
rescue => e
p "fd = " + fd.inspect
p "io = " + io.inspect
raise e
end
end
end.join
}}}
Result:
{{{
$ DYLD_LIBRARY_PATH=. ./miniruby ~/tmp/test_io.rb
"fd = 5"
"io = #<IO:fd 5>"
/Users/watson/tmp/test_io.rb:6:in `block': Bad file descriptor - write()
failed (Errno::EBADF)
from /Users/watson/tmp/test_io.rb:2:in `block'
}}}
--
Ticket URL: <http://www.macruby.org/trac/ticket/1457>
MacRuby <http://macruby.org/>
More information about the macruby-tickets
mailing list