Bug 514117

Summary: KZip can't create zip files > 4GB
Product: [Frameworks and Libraries] frameworks-karchive Reporter: Randall Rude <rsquared42>
Component: generalAssignee: KIO Bugs <kio-bugs-null>
Status: REPORTED ---    
Severity: normal CC: kdelibs-bugs-null
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Randall Rude 2026-01-03 17:41:51 UTC
This was reported as KPhotoAlbum bug 512199 but is actually a bug in KZip.

SUMMARY

If KZip is asked to zip files of size ~4GB or more, it will create an invalid zip file.
 
STEPS TO REPRODUCE
$ du -sh ~/images/2017
5.4G    /home/me/images/2017
$ ~/kde/build/karchive/bin/kziptest create test.zip ~/images/2017/*
$ echo $?
0
$ ~/kde/build/karchive/bin/kziptest print-all test.zip 
Opening zip file
Could not open "test.zip" for reading. ZIP file doesn't exist or is invalid: "Invalid ZIP file. Unrecognized header at offset 369583458"
$ unzip -t test.zip
Archive:  test.zip
warning [test.zip]:  4294967296 extra bytes at beginning or within zipfile
  (attempting to process anyway)
file #1:  bad zipfile offset (local header sig):  4294967296
  (attempting to re-compensate)
    testing: filename.JPG   OK
error: not enough memory for bomb detection
At least one error was detected in test.zip.

OBSERVED RESULT

KZip silently fails to create a valid zip file.

EXPECTED RESULT

KZip should create a valid zip file, or report an error to the application if it is unable to do so.

SOFTWARE/OS VERSIONS
$ kde-builder --show-info
kde-builder r618.11f4896
OS: ubuntu

ADDITIONAL INFORMATION
KArchive was built today using kde-builder.
$ git rev-parse HEAD
ea694e46b40f5ec4a21690ce814ca1485896cbc5