File#seek with Bignum argement breaks JRuby
-------------------------------------------

                 Key: JRUBY-2038
                 URL: http://jira.codehaus.org/browse/JRUBY-2038
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
         Environment: Latest JRuby 1.1RC1
            Reporter: Vladimir Sizikov
            Assignee: Vladimir Sizikov


f = File.open("/tmp/blah", "w+")
f.seek(2**128)

returns 0 on MRI, but fails hard on JRuby:
Exception in thread "main" java.lang.ClassCastException: org.jruby.RubyBignum 
cannot be cast to org.jruby.RubyFixnum
        at org.jruby.RubyNumeric.fix2long(RubyNumeric.java:225)
        at org.jruby.RubyIO.seek(RubyIO.java:1075)
        at org.jruby.RubyIOInvoker$seek_method_1_1.call(Unknown Source)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:166)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:301)
        at org.jruby.evaluator.ASTInterpreter.callNode(ASTInterpreter.java:653)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:300)
        at org.jruby.evaluator.ASTInterpreter.rootNode(ASTInterpreter.java:1601)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:449)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
        at 
org.jruby.evaluator.ASTInterpreter.evalWithBinding(ASTInterpreter.java:217)
        at org.jruby.RubyKernel.eval(RubyKernel.java:764)
        at org.jruby.RubyKernelInvoker$eval_method_1_3.call(Unknown Source)
        at 
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:65)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:298)
        at 
org.jruby.evaluator.ASTInterpreter.fCallNode(ASTInterpreter.java:1096)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:346)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:175)
        at 
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:65)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:298)
        at org.jruby.evaluator.ASTInterpreter.callNode(ASTInterpreter.java:653)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:300)
        at 
org.jruby.evaluator.ASTInterpreter.setupArgs(ASTInterpreter.java:2140)
        at 
org.jruby.evaluator.ASTInterpreter.fCallNode(ASTInterpreter.java:1091)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:346)
        at org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:627)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:294)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:175)
        at 
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:65)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:298)
        at org.jruby.evaluator.ASTInterpreter.callNode(ASTInterpreter.java:653)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:300)
        at org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:627)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:294)
        at 
org.jruby.evaluator.ASTInterpreter.rescueNode(ASTInterpreter.java:1503)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:443)
        at org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:627)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:294)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
        at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:150)
        at org.jruby.runtime.Block.yield(Block.java:114)
        at 
org.jruby.evaluator.ASTInterpreter.yieldNode(ASTInterpreter.java:1803)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:484)
        at 
org.jruby.evaluator.ASTInterpreter.ensureNode(ASTInterpreter.java:1068)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:340)
        at org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:627)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:294)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:175)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:310)
        at 
org.jruby.evaluator.ASTInterpreter.fCallNode(ASTInterpreter.java:1101)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:346)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
        at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:150)
        at org.jruby.runtime.Block.yield(Block.java:114)
        at 
org.jruby.evaluator.ASTInterpreter.yieldNode(ASTInterpreter.java:1803)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:484)
        at org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:627)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:294)
        at 
org.jruby.evaluator.ASTInterpreter.rescueNode(ASTInterpreter.java:1503)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:443)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
        at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:150)
        at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:115)
        at org.jruby.runtime.Block.yield(Block.java:109)
        at org.jruby.RubyKernel.loop(RubyKernel.java:955)
        at org.jruby.RubyKernelInvoker$loop_method_0_0.call(Unknown Source)
        at 
org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroBlock.call(JavaMethod.java:101)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:151)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:313)
        at 
org.jruby.evaluator.ASTInterpreter.fCallNode(ASTInterpreter.java:1101)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:346)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
        at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:150)
        at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:115)
        at org.jruby.runtime.Block.yield(Block.java:109)
        at org.jruby.RubyKernel.rbCatch(RubyKernel.java:793)
        at org.jruby.RubyKernelInvoker$rbCatch_method_1_0.call(Unknown Source)
        at 
org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneBlock.call(JavaMethod.java:139)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:151)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:313)
        at 
org.jruby.evaluator.ASTInterpreter.fCallNode(ASTInterpreter.java:1101)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:346)
        at org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:627)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:294)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:175)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:151)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:313)
        at org.jruby.evaluator.ASTInterpreter.callNode(ASTInterpreter.java:658)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:300)
        at org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:627)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:294)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:175)
        at 
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:65)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:166)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:301)
        at org.jruby.evaluator.ASTInterpreter.callNode(ASTInterpreter.java:653)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:300)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
        at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:150)
        at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:115)
        at org.jruby.runtime.Block.yield(Block.java:109)
        at org.jruby.RubyKernel.rbCatch(RubyKernel.java:793)
        at org.jruby.RubyKernelInvoker$rbCatch_method_1_0.call(Unknown Source)
        at 
org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneBlock.call(JavaMethod.java:139)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:151)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:313)
        at 
org.jruby.evaluator.ASTInterpreter.fCallNode(ASTInterpreter.java:1101)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:346)
        at org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:627)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:294)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:175)
        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.jruby_dot_git.bin.jirb.__file__(/opt/work/jruby/bin/jirb:13)
        at ruby.opt.work.jruby_dot_git.bin.jirb.load(/opt/work/jruby/bin/jirb)
        at org.jruby.Ruby.runScript(Ruby.java:485)
        at org.jruby.Ruby.runNormally(Ruby.java:405)
        at org.jruby.Ruby.runFromMain(Ruby.java:285)
        at org.jruby.Main.run(Main.java:142)
        at org.jruby.Main.run(Main.java:88)
        at org.jruby.Main.main(Main.java:79)

Fix is coming.

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