File#reopen blows with IllegalArgumentException in some cases
-------------------------------------------------------------

                 Key: JRUBY-2071
                 URL: http://jira.codehaus.org/browse/JRUBY-2071
             Project: JRuby
          Issue Type: Bug
    Affects Versions: JRuby 1.1RC1
         Environment: Latest JRuby 1.1RC1 (r5843)
            Reporter: Vladimir Sizikov
            Assignee: Thomas E Enebo
            Priority: Blocker
             Fix For: JRuby 1.1RC2
         Attachments: file-reopen.rb

This is a reduced version of rubicon test failure.

Please also note that changing BUFSIZE form 16kb to 16bytes in 
ChannelStream.java eliminates
the failure, but not really appropriate for other reasons :)

{noformat}
jruby file-reopen.rb
Exception in thread "main" java.lang.IllegalArgumentException
        at sun.nio.ch.FileChannelImpl.position(FileChannelImpl.java:280)
        at org.jruby.util.io.ChannelStream.fseek(ChannelStream.java:436)
        at org.jruby.util.io.OpenFile.seek(OpenFile.java:105)
        at org.jruby.RubyIO.reopen(RubyIO.java:429)
        at org.jruby.RubyIOInvoker$reopen_method_1_1.call(Unknown Source)
        at 
org.jruby.internal.runtime.methods.JavaMethod$JavaMethodNoBlock.call(JavaMethod.java:63)
        at 
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:77)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:211)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:361)
        at 
ruby.opt.work.samples.file_minus_reopen_dot_rb.__file__(file-reopen.rb:16)
        at ruby.opt.work.samples.file_minus_reopen_dot_rb.load(file-reopen.rb)
        at org.jruby.Ruby.runScript(Ruby.java:492)
        at org.jruby.Ruby.runNormally(Ruby.java:412)
        at org.jruby.Ruby.runFromMain(Ruby.java:292)
        at org.jruby.Main.run(Main.java:142)
        at org.jruby.Main.run(Main.java:88)
        at org.jruby.Main.main(Main.java:79)
{noformat}

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


Reply via email to