GNOME Bugzilla – Bug 415056
Cruft remaining after failed archive index attempt
Last modified: 2007-03-10 16:08:44 UTC
Please describe the problem: I find cruft in /tmp that is due to failures of the archive filter. I find several exceptions in *-IndexHelperExceptions: 20070305 07:24:53.1690 09917 IndexH WARN EX: Unable to filter /home/double/src/tagsoup-1.0.1-src.zip: 20070305 07:24:53.1690 09917 IndexH WARN EX: System.ArgumentOutOfRangeException: Argument is out of range. 20070305 07:24:53.1690 09917 IndexH WARN EX: Parameter name: length 20070305 07:24:53.1690 09917 IndexH WARN EX: at ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.ReadClearTextBuffer (System.Byte[] outBuffer, Int32 offset, Int32 length) [0x00000] 20070305 07:24:53.1690 09917 IndexH WARN EX: at ICSharpCode.SharpZipLib.Zip.ZipInputStream.BodyRead (System.Byte[] b, Int32 off, Int32 len) [0x00000] 20070305 07:43:04.5459 09917 IndexH WARN EX: Unable to filter /home/double/text/apple2/tw2.bas.zip: 20070305 07:43:04.5459 09917 IndexH WARN EX: ICSharpCode.SharpZipLib.Zip.ZipException: Unknown compression method 1 20070305 07:43:04.5459 09917 IndexH WARN EX: at ICSharpCode.SharpZipLib.Zip.ZipInputStream.GetNextEntry () [0x00000] 20070305 07:43:04.5459 09917 IndexH WARN EX: at (wrapper remoting-invoke-with-check) ICSharpCode.SharpZipLib.Zip.ZipInputStream:GetNextEntry () 20070305 07:51:40.7691 09917 IndexH WARN EX: Unable to filter /home/double/qemu/drivers/amnhltm.zip: 20070305 07:51:40.7691 09917 IndexH WARN EX: ICSharpCode.SharpZipLib.Zip.ZipException: Unknown compression method 6 20070305 07:51:40.7691 09917 IndexH WARN EX: at ICSharpCode.SharpZipLib.Zip.ZipInputStream.GetNextEntry () [0x00000] 20070305 07:51:40.7691 09917 IndexH WARN EX: at (wrapper remoting-invoke-with-check) ICSharpCode.SharpZipLib.Zip.ZipInputStream:GetNextEntry () 20070305 07:54:04.9141 09917 IndexH WARN EX: Unable to filter /home/double/projects/pdouble/DPMI.zip: 20070305 07:54:04.9141 09917 IndexH WARN EX: System.ArgumentOutOfRangeException: Argument is out of range. 20070305 07:54:04.9141 09917 IndexH WARN EX: Parameter name: length 20070305 07:54:04.9141 09917 IndexH WARN EX: at ICSharpCode.SharpZipLib.Zip.Compression.Streams.InflaterInputBuffer.ReadClearTextBuffer (System.Byte[] outBuffer, Int32 offset, Int32 length) [0x00000] 20070305 07:54:04.9141 09917 IndexH WARN EX: at ICSharpCode.SharpZipLib.Zip.ZipInputStream.BodyRead (System.Byte[] b, Int32 off, Int32 len) [0x00000] 20070305 10:45:17.4957 09917 IndexH WARN EX: Unable to filter /home/double/school/UNL/cse476/feature/prototype.ps.zip: 20070305 10:45:17.4957 09917 IndexH WARN EX: ICSharpCode.SharpZipLib.Zip.ZipException: size mismatch: 31623;138722 <-> 31623;138798 20070305 10:45:17.4957 09917 IndexH WARN EX: at ICSharpCode.SharpZipLib.Zip.ZipInputStream.BodyRead (System.Byte[] b, Int32 off, Int32 len) [0x00000] If you'd like the ZIP files I can upload those. Steps to reproduce: 1. Run beagle-extract-content on one of these ZIP files Actual results: I get an exception and cruft in /tmp/tmp*.* Expected results: An exception is acceptable, but no files left in /tmp/tmp*.* Does this happen every time? Yes Other information: I'm running trunk as of approx Mon Mar 5 14:00:00 CST 2007.
Ah, you found the cause straight away. :) Sure, attaching one of the broken zip files would be good. We probably can't fix the exception -- it is in an assembly shipped as part of Mono -- but we can definitely fix the tmpfile issue.
> Sure, attaching one of the broken zip files would be good. We probably can't > fix the exception -- it is in an assembly shipped as part of Mono -- but we The SharpZLib package throws lots of exceptions for perfectly valid archives. Frustrated I downloaded mono's copy of SharpZLib source and built it and tested it. Surprisingly it does not throw some of the exceptions that the binary sharpzlib.dll throws. This was about 2 months back and things might have improved since. Putting it here just for record.
Created attachment 84004 [details] tagsoup src, causes exception when extracting
Mono ships two versions of SharpZipLib: 0.60 and 0.84, IIRC. We were using 0.60 until fairly recently -- around the time we switched to gmcs. 0.84 definitely improved things, but there are still a lot of archives it barfs on.
I just checked in a fix for this, r3533. Thanks!
I updated to r3533 and I get the same behavior with the uploaded ZIP file. Any other info or tests you'd like me to try?
I'm using mono 1.2.3.1 if that makes a difference.
There was one other minor fix needed. r3539 fixes it. Tested with the attached archive. Pat, if you are still seeing issues, please reopen it. Otherwise, please mark it verified.
Ok. I lied. Its r3540.
Hmmm, not sure how I missed the big "Bug Status Change" header below or I would have reopened. :-S I verified with r3540, exception is logged (as expected) but processing continues on. Glad to see it even indexes what was able to be extracted and no cruft. Thanks.
Found another one. See attached ZIP. Note that these are not actually postscript files although they end in ".ps".
Created attachment 84304 [details] ZIP file causing cruft in /tmp Filename: file:///home/double/school/UNL/cse476/feature/prototype.ps.zip Debug: Loaded 53 filters from /usr/lib/beagle/Filters/Filters.dll Error: Caught exception extracting data from archive /home/double/school/UNL/cse476/feature/prototype.ps.zip ICSharpCode.SharpZipLib.Zip.ZipException: size mismatch: 31623;138722 <-> 31623;138798 at ICSharpCode.SharpZipLib.Zip.ZipInputStream.BodyRead (System.Byte[] b, Int32 off, Int32 len) [0x00256] in /var/tmp/paludis/dev-lang/mono-1.2.3.1/work/mono-1.2.3.1/mcs/class/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib/Zip/ZipInputStream.cs:510 at (wrapper delegate-invoke) System.MulticastDelegate:invoke_int_byte[]_int_int (byte[],int,int) at ICSharpCode.SharpZipLib.Zip.ZipInputStream.Read (System.Byte[] destination, Int32 index, Int32 count) [0x00000] in /var/tmp/paludis/dev-lang/mono-1.2.3.1/work/mono-1.2.3.1/mcs/class/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib/Zip/ZipInputStream.cs:425 at Beagle.Filters.FilterArchive.StoreStreamInTempFile (System.IO.Stream stream, System.String extension, DateTime mtime) [0x00042] in /var/tmp/paludis/app-misc/beagle-9999/work/beagle/Filters/FilterArchive.cs:216 Warn: Unable to filter /home/double/school/UNL/cse476/feature/prototype.ps.zip: ICSharpCode.SharpZipLib.Zip.ZipException: Wrong Local header signature: 0xD1E7B1B5 at ICSharpCode.SharpZipLib.Zip.ZipInputStream.GetNextEntry () [0x0032e] in /var/tmp/paludis/dev-lang/mono-1.2.3.1/work/mono-1.2.3.1/mcs/class/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib/Zip/ZipInputStream.cs:259 at (wrapper remoting-invoke-with-check) ICSharpCode.SharpZipLib.Zip.ZipInputStream:GetNextEntry () at Beagle.Filters.FilterArchive.GetNextEntryZip () [0x0000c] in /var/tmp/paludis/app-misc/beagle-9999/work/beagle/Filters/FilterArchive.cs:276 at (wrapper delegate-invoke) System.MulticastDelegate:invoke_FilterArchive/ArchiveEntry () at Beagle.Filters.FilterArchive.DoPullSetup () [0x00154] in /var/tmp/paludis/app-misc/beagle-9999/work/beagle/Filters/FilterArchive.cs:170 at Beagle.Daemon.Filter.Open (System.IO.FileSystemInfo info) [0x000c4] in /var/tmp/paludis/app-misc/beagle-9999/work/beagle/beagled/Filter.cs:620 No filter for application/zip
Checked in some more protection against SharpZLib stupidism - r3543. Give that a try.
Works here. I re-ran over all previously failed archives and no cruft. Thanks!