Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jruby 9000 RC1 throws Java::JavaLang::ClassCastException: org.jruby.RubyBignum cannot be cast to org.jruby.RubyFixnum #3118

Closed
bigsur0 opened this issue Jul 8, 2015 · 3 comments

Comments

@bigsur0
Copy link
Contributor

@bigsur0 bigsur0 commented Jul 8, 2015

cmd: rvm use jruby-1.7.19
cmd: irb
>> (0...2**64).max
=> 18446744073709551615

VS.

cmd: rvm use jruby-9.0.0.0.rc1
cmd: irb
>> (0...2**64).max
Java::JavaLang::ClassCastException: org.jruby.RubyBignum cannot be cast to org.jruby.RubyFixnum
    from org.jruby.RubyRange.max(RubyRange.java:660)
    from org.jruby.RubyRange$INVOKER$i$max_DBG.call(RubyRange$INVOKER$i$max_DBG.gen)
    from org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroOrNBlock.call(JavaMethod.java:295)
    from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:293)
    from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:131)
    from org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:308)
    from org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:78)
    from org.jruby.ir.interpreter.Interpreter.INTERPRET_EVAL(Interpreter.java:127)
    from org.jruby.ir.interpreter.Interpreter.evalCommon(Interpreter.java:182)
    from org.jruby.ir.interpreter.Interpreter.evalWithBinding(Interpreter.java:207)
    from org.jruby.RubyKernel.evalCommon(RubyKernel.java:1012)
    from org.jruby.RubyKernel.eval19(RubyKernel.java:979)
    from org.jruby.RubyKernel$INVOKER$s$0$3$eval19_DBG.call(RubyKernel$INVOKER$s$0$3$eval19_DBG.gen)
    from org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:77)
    from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:83)
    from org.jruby.ir.instructions.CallBase.interpret(CallBase.java:419)
... 104 levels...
    from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:313)
    from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:163)
    from org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:292)
    from org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:78)
    from org.jruby.ir.interpreter.Interpreter.INTERPRET_ROOT(Interpreter.java:117)
    from org.jruby.ir.interpreter.Interpreter.execute(Interpreter.java:104)
    from org.jruby.ir.interpreter.Interpreter.execute(Interpreter.java:33)
    from org.jruby.ir.IRTranslator.execute(IRTranslator.java:42)
    from org.jruby.Ruby.runInterpreter(Ruby.java:879)
    from org.jruby.Ruby.runInterpreter(Ruby.java:887)
    from org.jruby.Ruby.runNormally(Ruby.java:759)
    from org.jruby.Ruby.runFromMain(Ruby.java:575)
    from org.jruby.Main.doRunFromMain(Main.java:401)
    from org.jruby.Main.internalRun(Main.java:296)
    from org.jruby.Main.run(Main.java:225)
    from org.jruby.Main.main(Main.java:197)>> quit
@enebo enebo added this to the JRuby 9.0.0.0 milestone Jul 9, 2015
@headius
Copy link
Member

@headius headius commented Jul 9, 2015

Marked as beginner. We can fix quickly before 9k final, but someone else might want to try.

@enebo enebo modified the milestone: JRuby 9.0.0.0 Jul 14, 2015
@bigsur0
Copy link
Contributor Author

@bigsur0 bigsur0 commented Jul 24, 2015

@enebo, should this be retagged for a point release of JRuby 9.0.0.0? I don't think it was fixed for the first release.

@kares kares added this to the JRuby 9.0.1.0 milestone Jul 30, 2015
@kares kares closed this in #3196 Jul 30, 2015
kares added a commit that referenced this issue Jul 30, 2015
Fixing ClassCastException reported in issue #3118
@bigsur0
Copy link
Contributor Author

@bigsur0 bigsur0 commented Jul 31, 2015

We should reopen this, after testing my case against jruby-head post merge against my own code base I get the following:

>> (0...2**64).max
RangeError: bignum too big to convert into `long'
    from org/jruby/RubyRange.java:662:in `max'
    from (irb):1:in `<eval>'
    from org/jruby/RubyKernel.java:978:in `eval'
    from org/jruby/RubyKernel.java:1291:in `loop'
    from org/jruby/RubyKernel.java:1098:in `catch'
    from org/jruby/RubyKernel.java:1098:in `catch'
    from /Users/rasik_pandey/.rvm/rubies/jruby-head/bin/irb:13:in `<top>'
bigsur0 added a commit to bigsur0/jruby that referenced this issue Jul 31, 2015
With my previous commit, RangeError: bignum too big to convert into `long' was the result when running (0...2**64).max

This commit ports handling for non-RubyFixnums from the 1.7.20 branch.

Addresses, jruby#3118
bigsur0 pushed a commit to bigsur0/jruby that referenced this issue Jul 31, 2015
With my previous commit, RangeError: bignum too big to convert into
`long' was the result when running (0...2**64).max

This commit ports handling for non-RubyFixnums from the 1.7.20 branch.

Addresses, jruby#3118
bigsur0 pushed a commit to bigsur0/jruby that referenced this issue Aug 4, 2015
With my previous commit, RangeError: bignum too big to convert into
`long' was the result when running (0...2**64).max

This commit ports handling for non-RubyFixnums from the 1.7.20 branch.

Addresses, jruby#3118
eregon added a commit to ruby/spec that referenced this issue Aug 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants