-
-
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
File.seek fails on large file #3435
Comments
The same happens when using
I tried with latest ubuntu 64-bit openjdk and
|
It seems like this is a regression of 9.0.4, as it works with 1.7.21: jruby 1.7.21 (1.9.3p551) 2015-07-07 a741a82 on Java HotSpot(TM) 64-Bit Server VM 1.8.0_66-b17 +jit [linux-amd64]
jruby 9.0.4.0 (2.2.2) 2015-11-12 b9fb7aa Java HotSpot(TM) 64-Bit Server VM 25.66-b17 on 1.8.0_66-b17 +jit [linux-amd64]
|
@headius Would be great to have this fixed in 9.0.5 👍 |
Is there anything we could do to get this fixed, liking sponsoring the fix? |
This almost sounds like we switch IO pos from a long to an int? Marking for 9.1.0.0. |
JRuby 9.1 is using a long for position in seek, but still failing. Looking into it. |
Ok, so there's one small bug and one big bug here. The small bug is that we were expecting all negative return values from The big bug is that our native I'm fixing the first one, which makes
Note the second larger problem rears its head here with I'm going to mark this fixed, since at least the error is gone now and seek is doing what it should under the covers. I'll open a new bug for the larger issue. |
See #3817 for the larger issue. |
@headius Thanks! 👍 |
File.seek fails on files 2GB or larger on Solaris and Linux.
Test program:
[2147483647, 2147483648].each do |position|
file = File.open('test.tar', 'rb')
file.seek(position)
puts "seek to #{position} succeeded"
end
output:
seek to 2147483647 succeeded
Errno::EBADF: Bad file number - test.tar
seek at org/jruby/RubyIO.java:1648
block in seek.rb at seek.rb:3
each at org/jruby/RubyArray.java:1560
at seek.rb:1
jruby 9.0.3.0 (2.2.2) 2015-10-21 633c9aa Java HotSpot(TM) 64-Bit Server VM 25.65-b01 on 1.8.0_65-b17 +jit [SunOS-amd64]
SunOS org00 5.11 omnios-f090f73 i86pc i386 i86pc
jruby 9.0.3.0 (2.2.2) 2015-10-21 633c9aa OpenJDK 64-Bit Server VM 25.45-b02 on 1.8.0_45-internal-b14 +jit [linux-amd64]
Linux worker04 3.13.0-67-generic #110-Ubuntu SMP Fri Oct 23 13:24:41 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
I discovered this when trying to use multipart uploads to S3 using the official aws-sdk gem.
When using the gem i got mostly Errno::EAGAIN and sometimes Errno::ENOENT. The test program seems to always fail with Errno::EBADF.
The same test program works fine on MRI: ruby 2.1.3p242 (2014-09-19 revision 47630) [i386-solaris2.11]
The text was updated successfully, but these errors were encountered: