-
-
Notifications
You must be signed in to change notification settings - Fork 925
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 crashes when reading large file #4704
Comments
@enebo public void ensure(int length) {
if (begin + length > bytes.length) {
byte[] tmp = new byte[Math.min(Integer.MAX_VALUE, length + (length >>> 1))];
System.arraycopy(bytes, begin, tmp, 0, realSize);
bytes = tmp;
begin = 0;
invalidate();
}
} length + (length >>> 1) may overflow |
Thanks @tlxxzj for update |
MRI uses a C Comparing JRuby's If this is the cause of the disparity, I would expect that replacing |
you can not create an array of a long length in Java. |
Text is now written to item details files directly rather than being part of template rendering in an attempt to prevent larger content text values from throwing the JRuby error described here: jruby/jruby#4704
Environment
starting jruby 9.0.3.0, crash when reading large file
code
Results in following stack trace:
Provide at least:
jruby -v
) and command line (flags, JRUBY_OPTS, etc)jruby 9.1.11.0-SNAPSHOT (2.3.3) 2017-06-14 83098f6 Java HotSpot(TM) 64-Bit Server VM 25.51-b03 on 1.8.0_51-b16 +jit [linux-x86_64]
JRUBY_OPTS="-J-server -J-Xmx10g -J-Xmn1024m -J-Xms2048m -J-XX:+UseG1GC"
uname -a
)Linux tsugaike 4.11.7-300.fc26.x86_64 break script engine #1 SMP Mon Jun 26 14:54:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Other relevant info you may wish to add:
Expected Behavior
Its possibly related to #3792
MRI can deal with strings that length.
So either jruby string length has to be int size and we are missing string bounds check,
or its a jruby bug because string that length can be read in mri
The text was updated successfully, but these errors were encountered: