IOError on broken gzip attachments

Bug #397150 reported by Leann Ogasawara
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Won't Fix
Low
Unassigned

Bug Description

Binary package hint: apport

I was testing the following bug pattern and the test-local script returned "IOError: CRC check failed 0x32353035 != 0x0L". I suspect it's because we're unable to successfully gunzip the file.

ogasawara@emiko:~/ubuntu-bugpatterns$ bzr diff linux.xml
=== modified file 'linux.xml'
--- linux.xml 2009-05-28 16:33:22 +0000
+++ linux.xml 2009-07-08 19:37:29 +0000
@@ -8,4 +8,10 @@
         <re key="ProcCmdLine">loop=/hostname/disks/home/username.disk</re>
  <re key="ErrorMessage">^unable to make backup link of.*before installing new version: Operation not permitted$</re>
     </pattern>
+ <pattern url="https://launchpad.net/bugs/269539">
+ <re key="DpkgTerminalLog">The file `/var/run/grub/menu.lst.ucf-new' has a record of the failed merge of the configuration file.</re>
+ </pattern>
+ <pattern url="https://launchpad.net/bugs/269539">
+ <re key="VarLogDistupgrade">The file `/var/run/grub/menu.lst.ucf-new' has a record of the failed merge of the configuration file.</re>
+ </pattern>
 </patterns>

ogasawara@emiko:~/ubuntu-bugpatterns$ ./test-local 372475
Traceback (most recent call last):
  File "./test-local", line 14, in <module>
    report = db.download(sys.argv[1])
  File "/usr/lib/python2.6/dist-packages/apport/crashdb_impl/launchpad.py", line 262, in download
    report[key] = gzip.GzipFile(fileobj=attachment).read()#TODO: is this the best solution?
  File "/usr/lib/python2.6/gzip.py", line 212, in read
    self._read(readsize)
  File "/usr/lib/python2.6/gzip.py", line 267, in _read
    self._read_eof()
  File "/usr/lib/python2.6/gzip.py", line 304, in _read_eof
    hex(self.crc)))
IOError: CRC check failed 0x32353035 != 0x0L

ogasawara@emiko:/tmp$ gunzip VarLogDistupgrade200905052255.gz

gzip: VarLogDistupgrade200905052255.gz: unexpected end of file

ProblemType: Bug
Architecture: i386
Date: Wed Jul 8 12:40:39 2009
DistroRelease: Ubuntu 9.10
Package: apport 1.5-0ubuntu2
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-2.16-generic
SourcePackage: apport
Uname: Linux 2.6.31-2-generic i686

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :
Revision history for this message
Brian Murray (brian-murray) wrote :

The attached patch works around the issue by adding a handler for the IOError, it is useful if you are testing a pattern with a list of bug reports.

Changed in apport (Ubuntu):
status: New → Triaged
importance: Undecided → Low
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Martin Pitt (pitti) wrote :

Brian, but how does replacing one exception with another help with testing patterns? It will crash either way, after all?

Also, catching all IOErrors is a bit too much, since in theory you could also have "file not found" and similar errors.

If the attachment is broken, I'd rather recommend to delete it from Launchpad first.

summary: - test-local script fails with IOError: CRC check failed 0x32353035 !=
- 0x0L
+ IOError on broken gzip attachments
Revision history for this message
Brian Murray (brian-murray) wrote :

I added a search-bugs script to the bugpatterns bzr branch for running a list of bugs against a package's bug pattern and the exception was causing me problems, but I've worked around it in the search-bugs script. So the patch seems unnecessary.

WIth regards to the broken attachment - there are quite a few of these in Launchpad and I'd imagine they will continue to come in. See further bug 369951.

Revision history for this message
Martin Pitt (pitti) wrote :

OK, closing then. I'd much rather keep the original precise exception than a generic "Exception" which also catches false positives.

Changed in apport (Ubuntu):
assignee: Martin Pitt (pitti) → nobody
status: Triaged → Won't Fix
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Sorry to reopen the case. When batch processing reports, it's sometimes annoying to skip the whole report because only 1 attachment is corrupted (e.g bug 537463, I agree there are not a lot of them)
The attached patch use a more restrictive exception handling. Would it be acceptable ?

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.