ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 38563] New: - Tar target cannot add file with size > 2GB
Date Wed, 08 Feb 2006 05:55:07 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38563>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38563

           Summary: Tar target cannot add file with size > 2GB
           Product: Ant
           Version: 1.6.5
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: sagar.ipte@gmail.com


Hello:

While adding a file with size > 2GB in tar file using tar task of ant, I am getting exception
similar to

“request to write '1024' bytes exceeds size in header of '-2147483648' bytes”

This is thrown at line 238 in TarOutputStream.

I looked into the code, and it seems the issue is related to downcasting of long value to
int.

TarEntry reads the file size as long which is correct.
But when TarEntry is added into TarOutputStream (line 138), TarOutputStream downcasts file
size value 
from long to int

line 167 in TarOutputStream is as follows
this.currSize = (int) entry.getSize();

This is incorrect, this way it will never allow to add file size > than 2147483647 bytes
i.e 2GB.
TarOutputStream should maintain entry size as long only.


Thanks
- Sagar

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message