Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
1.22
-
None
Description
Writing large entries (>1.1 TB) end with an integer overflow
Caused by: java.lang.ArithmeticException: integer overflow at java.base/java.lang.Math.addExact(Math.java:883) at org.apache.commons.compress.utils.ExactMath.add(ExactMath.java:43) at org.apache.commons.compress.archivers.tar.TarArchiveOutputStream.closeArchiveEntry(TarArchiveOutputStream.java:439)
The problem occurs due to the following add exact that was introduced in 1.22 that detects overflows(harmless in this case since the value is only used in modulo checks):
recordsWritten = ExactMath.add(recordsWritten, (currSize / RECORD_SIZE));
Attachments
Issue Links
- links to