Archive::Zip does not close temporary archive files

Bug #1535121 reported by Eugene Savelov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libarchive-zip-perl (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Ubuntu 15.10 contains Archive::Zip v 1.49 that apparently has a bug that creating/updating a zip archive file does not close it , and creating many files generates "too many open files" error similar to this -

IO error: Can't open <.......>: Too many open files at /usr/share/perl5/Archive/Zip/FileMember.pm line 40. Archive::Zip::FileMember::_openFile(Archive::Zip::ZipFileMember=HASH(0x23e62b0)) called at /usr/share/perl5/Archive/Zip/FileMember.pm line 30 Archive::Zip::FileMember::fh(Archive::Zip::ZipFileMember=HASH(0x23e62b0)) called at /usr/share/perl5/Archive/Zip/ZipFileMember.pm line 384 Archive::Zip::ZipFileMember::rewindData(Archive::Zip::ZipFileMember=HASH(0x23e62b0)) called at /usr/share/perl5/Archive/Zip/Member.pm line 1059 Archive::Zip::Member::_writeToFileHandle(Archive::Zip::ZipFileMember=HASH(0x23e62b0), IO::File=GLOB(0x24399d0), 1, 0) called at /usr/share/perl5/Archive/Zip/Archive.pm line 420 Archive::Zip::Archive::writeToFileHandle(Archive::Zip::Archive=HASH(0x242eda8), IO::File=GLOB(0x24399d0)) called at /usr/share/perl5/Archive/Zip/Archive.pm line 456 Archive::Zip::Archive::overwriteAs(Archive::Zip::Archive=HASH(0x242eda8), "<.......>") called at /usr/share/perl5/Archive/Zip/Archive.pm line 440
Archive::Zip::Archive::overwrite(Archive::Zip::Archive=HASH(0x242eda8)) called at ./arcoper.pl line 57

lsof -p <pid> shows all /tmp/*zip files deleted, but still open, up to max open files (1000 which is system default)
Increasing number of files in limits.conf makes the problem generate less frequently.

installing latest version 1.56 from cpan fixes the problem - Using many zip files correctly closes them, does not generate errors, and lsof -p <pid> shows only several files (less than 20)

Eugene Savelov (savelov)
description: updated
description: updated
Eugene Savelov (savelov)
summary: - Archive::Zip does not close archive files
+ Archive::Zip does not close temporary archive files
Revision history for this message
gregor herrmann (gregoa) wrote :

That's probably https://github.com/redhotpenguin/perl-Archive-Zip/pull/22

Included in upstream's 1.54 release according to their Changes file.

Revision history for this message
Florian Schlichting (fschlich) wrote :

fixed in 1.54 (xenial and later)

Changed in libarchive-zip-perl (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.