[ https://issues.apache.org/jira/browse/COMPRESS-642?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17939404#comment-17939404 ]
Peter Rader commented on COMPRESS-642: -------------------------------------- Not sure if this must be reopened, same for long overflow. See >From https://issues.apache.org/jira/browse/MDEP-978 > Integer overflow ArithmeticException in TarArchiveOutputStream > -------------------------------------------------------------- > > Key: COMPRESS-642 > URL: https://issues.apache.org/jira/browse/COMPRESS-642 > Project: Commons Compress > Issue Type: Bug > Components: Compressors > Affects Versions: 1.22 > Reporter: Anton Klarén > Priority: Critical > Fix For: 1.23.0 > > > Writing large entries (>1.1 TB) end with an integer overflow > {noformat} > 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) > {noformat} > 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): > {code:java} > recordsWritten = ExactMath.add(recordsWritten, (currSize / RECORD_SIZE)); > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)