Affects Version/s: JRuby 1.7.0.pre1
Fix Version/s: JRuby 1.7.0.pre2
Component/s: Application Error
Environment:I'm running Microsoft Windows Vista with Java Client VM 1.6.0_14, but I think the problem is likely to independent of the platform.
Number of attachments :
This seems to be a problem in 1.7.0.preview1 and in 1.6.7; I haven't tried it in other JRuby versions, but I suspect it will be a problem in other JRuby versions.
In JIRB or run as a JRuby program:
JRUBY-6612 I reported an integer overflow problem in RubyFixnum.java in
public IRubyObject op_mul
and also gave examples of some strange behaviour of Range#each
with integer values near the maximum Fixnum value.
The reported integer overflow problem seems to have been fixed in
but I still seem to be getting this sometimes strange behaviour of Range#each.
I've put below extracts from RubyRange.java: it seems that the problem may arise in "private void rangeEach".
I suspect that the problems of examples (1) and (2) above might be caused (at least partly) by a problem with Integer#succ which I've reported here:
JRUBY-6778 Possible long integer overflow bug in Integer#succ in RubyInteger.java
So fixing that Integer#succ problem may fix (1) and (2).
But it's not clear to me from the RubyRange.java code why the exclusive range in (3) works but the inclusive range in (4) doesn't work, and I don't have a sufficient understanding of the interaction between the underlying Java code for various JRuby classes to see what is the cause of the problem.