Bug 155704 - Can not handle a IFile larger than 2GB (2147483647 bytes)
Summary: Can not handle a IFile larger than 2GB (2147483647 bytes)
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux-GTK
: P3 normal with 1 vote (vote)
Target Milestone: 3.4 M4   Edit
Assignee: Platform-Resources-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, contributed
Depends on:
Blocks:
 
Reported: 2006-08-30 12:04 EDT by David Kyle CLA
Modified: 2007-12-12 05:00 EST (History)
3 users (show)

See Also:
john.arthorne: review+


Attachments
patch for Large File Support (LFS) (3.73 KB, patch)
2007-11-27 14:37 EST, David Kyle CLA
no flags Details | Diff
Library for linux x86 (6.44 KB, application/octet-stream)
2007-12-07 12:28 EST, Szymon Brandys CLA
no flags Details
Build info for the native lib (353 bytes, text/plain)
2007-12-07 12:48 EST, Szymon Brandys CLA
no flags Details
Build info for the native lib (353 bytes, text/plain)
2007-12-07 12:49 EST, Szymon Brandys CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Kyle CLA 2006-08-30 12:04:26 EDT
Only appears on linux (works with Windows XP). A file larger than 2147483647 bytes will not appear in the workbench as an IResource.

Problem appears to be in LocalFileNatives.fetchFileInfo(). The file length always returns as zero. If I trick the LocalFileNatives to not load the plugin library (i.e. hasNatives == false by corrupting the System.loadLibrary() call...ugly but it works) then I can load files larger than 2147483647 bytes into the workspace.

Create a file that is 2147483647 bytes or larger. Link or copy it into your workspace. Do a refresh (F5). The file will not appear. No errors/warnings/traces messages are logged.

We consider a 2GB file to of a modest size. Is there a work around?

This problem is hinted at in bug 149812.

java.version=1.5.0_01
BootLoader constants: OS=linux, ARCH=x86, WS=gtk
Red Hat Linux release 9 (Shrike) Kernel 2.4.20-8smp on an i686
Comment 1 David Kyle CLA 2006-09-06 12:13:22 EDT
Work around is to exclude the org.eclipse.core.filesystem.linux.x86* plugin. This forces the use of the Java IO package which can correctly report a filesize greater than 2GB.

Any ideas as to the performance lost by not using the native org.eclipse.core.filesystem.* plugin?
Comment 2 DJ Houghton CLA 2006-09-06 13:16:08 EDT
I don't have numbers, but the fragment is used for:

- performance - since multiple calls are made to the filesystem to get information about the files and folders, we bundle them all into one call and then pull interesting info out of the resulting data structure (flags, timestamps, gender, etc)
- timestamp granularity - some VMs have really bad granularity when calling File#lastModified (we came across one that rounded to the closest 2 second)
- setReadOnly - there used to be problems with this call on java.io.File (but it may be fixed now)

(might be more reasons now but those were the original ones)
Comment 3 David Kyle CLA 2006-09-09 16:57:24 EDT
Thanks for the info. Any idea when this limitation will be fixed?
Comment 4 David Kyle CLA 2007-09-12 18:59:59 EDT
A year has passed. Are we past the 2GB file size limit?
Comment 5 DJ Houghton CLA 2007-11-12 15:37:18 EST
Szymon, what are your thoughts on this? Are we just calling the wrong native in our library or is the change deeper than that? This bug is interesting in terms of plan item bug 200102.
Comment 6 Szymon Brandys CLA 2007-11-13 08:37:00 EST
The 'ls' command on Linux returns size 0 for >2GB file as well.

AFAIK this is a limitation of Linux kernel. I can attach some links to it, but it is easy to find some articles.

Since this is a common problem with Linux, we should handle it above e.g. trying to show the resource anyway. The other way is to use java.io since the problem seems to be solve there.
Comment 7 Szymon Brandys CLA 2007-11-13 09:44:30 EST
I want to address the bug, however if the bug day comes first, maybe it will be a challenge for someone.
Comment 8 David Kyle CLA 2007-11-13 10:08:02 EST
For those who are interested here is a quick way to create a 5GB file to test
your linux installation.

$ dd if=/dev/zero of=bigfile.dat bs=1024 count=5242880
$ ls -lh bigfile.dat

Are you sure you are not mixing up a linux kernel issue with other file size
constraints caused by the file system type or libc version?

We`ve found the work around of deleting the
org.eclipse.core.filesystem.linux.x86* plugin to be a very awkward fix. When
the org.eclipse.platform feature is updated by the update manager the
org.eclipse.core.filesystem.linux.x86* reappears. :(
Comment 9 David Kyle CLA 2007-11-15 15:26:04 EST
(In reply to comment #7)
> I want to address the bug, however if the bug day comes first, maybe it will be
> a challenge for someone.
Ok, I'll take a shot at it.
Comment 10 David Kyle CLA 2007-11-27 14:37:07 EST
Created attachment 83892 [details]
patch for Large File Support (LFS)

I'm not sure how the Mac handles LFS so I left it unchanged.
Comment 11 Szymon Brandys CLA 2007-12-05 08:31:47 EST
David, I verified the patch on Linux and it works. Have you verified that it works on other Unix platforms?
Comment 12 Szymon Brandys CLA 2007-12-05 08:48:29 EST
I dispel your doubts David... For Mac this is not an issue.
Comment 13 David Kyle CLA 2007-12-05 10:12:52 EST
(In reply to comment #11)

I tested Centos and Solaris 8 and 9. I don't have access to the other flavours of unix. From what I've read it should work.
Comment 14 John Arthorne CLA 2007-12-06 14:30:57 EST
I have released the Makefile patches. Szymon, can you attach a compiled library for x86 linux so I can commit it?
Comment 15 Szymon Brandys CLA 2007-12-07 12:28:20 EST
Created attachment 84756 [details]
Library for linux x86
Comment 16 Szymon Brandys CLA 2007-12-07 12:48:04 EST
Created attachment 84757 [details]
Build info for the native lib
Comment 17 Szymon Brandys CLA 2007-12-07 12:49:38 EST
Created attachment 84758 [details]
Build info for the native lib
Comment 18 Szymon Brandys CLA 2007-12-07 12:51:18 EST
The tests on Linux has passed.
Comment 19 David Kyle CLA 2007-12-07 12:54:52 EST
I dropped the "Library for linux x86" directly into our application and it
works. Our +300 gigabyte sized files appear! :)

Thanks Szymon.
Comment 20 John Arthorne CLA 2007-12-07 13:28:04 EST
Patch released for Linux fragment. Thanks to you David for doing the work on this - we just compiled and released it.
Comment 21 Szymon Brandys CLA 2007-12-07 18:47:07 EST
Right. Thanks David. As a reward, you can choose the next one to fix ;-)
Comment 22 Szymon Brandys CLA 2007-12-12 05:00:31 EST
Verified in I20071210-1800.