[MacRuby] #1458: Errno::EBADF occurs when use IO.pipe and IO.for_fd with MultiThread
#1458: Errno::EBADF occurs when use IO.pipe and IO.for_fd with MultiThread ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: ----------------------------------+----------------------------------------- Test Script: {{{ Thread.start do loop do begin r, w = IO.pipe w.write("a") r.read(10) GC.start rescue => e p "r = " + r.inspect p "w = " + w.inspect p e end end end loop do begin fd = IO.sysopen("/tmp/aaa.txt", "w") io = IO.for_fd(fd) io.write("aaaa") GC.start rescue => e p "fd = " + fd.inspect p "io = " + io.inspect raise e end end }}} Result: {{{ $ macruby test_io.rb "r = #<IO:fd 6>" "w = #<IO:fd 5>" #<Errno::EBADF: Bad file descriptor - write() failed> "fd = 5" "io = nil" /Users/watson/tmp/test_io.rb:19:in `block': Bad file descriptor (Errno::EBADF) from /Users/watson/tmp/test_io.rb:16:in `<main>' }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1458> MacRuby <http://macruby.org/>
#1458: Errno::EBADF occurs when use IO.pipe and IO.for_fd with MultiThread ----------------------------------+----------------------------------------- Reporter: watson1978@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: Component: MacRuby | Resolution: invalid Keywords: | ----------------------------------+----------------------------------------- Changes (by watson1978@…): * status: new => closed * resolution: => invalid Comment: Sorry, it looks like I ran test code without latest. Test code works fine. -- Ticket URL: <http://www.macruby.org/trac/ticket/1458#comment:1> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby