There seem to be some bugs where the Java code underlying JRuby seems to not detect Long arithmetic overflows.
For example, on my PCs running this code in JRuby:
results in this output:
I seem to have some problems with Fixnum multiplication (as above),
and with Fixnum/Bignum Range#each and Range#each_with_index.
There are more examples and information in the attached JRuby file.
My apologies if I am making a mistake, or if these issues have been raised before: I searched jira.codehaus.org using "JRuby overflow", but didn't find anything that seemed to cover the examples in the attached file.
I wasn't sure what priority to give this: if I'm correct that these are bugs with Fixnum (etc) then they would seem to be "major", but if no-one else has noticed these before then in practice there hasn't so far been a problem.
In the attached file I've put a possible patch for one occurrence of the Fixnum multiply overflow problem, but there may be other places where patches are needed, and there is also the Fixnum/Bignum range problem: I'm afraid I haven't looked at all at the JRuby Java code for that.
I would be happy to give more details and/or answer any questions.