IO read fails with "Bad file descriptor error" on IBM/AIX, Java 1.5
-------------------------------------------------------------------
Key: JRUBY-4466
URL: http://jira.codehaus.org/browse/JRUBY-4466
Project: JRuby
Issue Type: Bug
Components: IBM/Other VM
Affects Versions: JRuby 1.4
Environment: IBN/AIX, Java 1.4 with JRUBY-4296 patch applied
(--noclient)
Reporter: Matt Mitchell
When reading large streams, a seemingly random, bad file descriptor error
occurs. Sample code below.
Here is my java info:
java -version
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build pap32dev-20051104)
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 AIX ppc-32 j9vmap3223-20051103 (JIT
enabled)
J9VM - 20051027_03723_bHdSMR
JIT - 20051027_1437_r8
GC - 20051020_AA)
JCL - 20051102
Here is info on the platform: "J9" VM - http://en.wikipedia.org/wiki/IBM_J9
and example code to re-create this error (note, this is somewhat random)
require 'fileutils'
File.open 'test_data.txt', 'w' do |f|
1_000_000.times do |i|
f.puts i
end
end
IO.popen "cat test_data.txt", 'r' do |io|
while line = io.gets
end
end
and the resulting stack trace:
Thread.java:-2:in `getStackTraceImpl': EBADF - Bad file descriptor
(Errno::EBADF)
from Thread.java:1109:in `getStackTrace'
from RubyException.java:139:in `setBacktraceFrames'
from RaiseException.java:171:in `setException'
from RaiseException.java:73:in `<init>'
from Ruby.java:3073:in `newRaiseException'
from Ruby.java:2825:in `newErrnoEBADFError'
from OpenFile.java:298:in `finalize'
from OpenFile.java:247:in `cleanup'
from RubyIO.java:1992:in `close2'
from RubyIO.java:1970:in `close'
from RubyIO.java:3397:in `popen'
from org/jruby/RubyIO$s_method_0_1$RUBYINVOKER$popen.gen:-1:in `call'
from DynamicMethod.java:188:in `call'
from CachingCallSite.java:340:in `cacheAndCall'
from CachingCallSite.java:198:in `callBlock'
from CachingCallSite.java:213:in `callIter'
from run_all.rb:9:in `__file__'
from run_all.rb:-1:in `load'
from Ruby.java:628:in `runScript'
from Ruby.java:550:in `runNormally'
from Ruby.java:396:in `runFromMain'
from Main.java:272:in `run'
from Main.java:117:in `run'
from Main.java:97:in `main'
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email