apport crashed with : struct.error: unpack requires a bytes object of length 4 in problem_report.py, line 75, in write

Bug #1064357 reported by Jean-Baptiste Lallement
90
This bug affects 56 people
Affects Status Importance Assigned to Milestone
Python
Fix Released
Unknown
apport (Ubuntu)
Invalid
High
Unassigned

Bug Description

Quantal armhf up to date

Apport crashed with the error below following an apt-xapian-index crash. apport crash file attached.

Traceback:
 Traceback (most recent call last):
   File "/usr/share/apport/apport-gtk", line 575, in <lambda>
     GLib.idle_add(lambda: self.collect_info(on_finished=self.ui_update_view))
   File "/usr/lib/python3/dist-packages/apport/ui.py", line 983, in collect_info
     icthread.exc_raise()
   File "/usr/lib/python3/dist-packages/apport/REThread.py", line 64, in exc_raise
     raise self._exception[1].with_traceback(self._exception[2])
   File "/usr/lib/python3/dist-packages/apport/REThread.py", line 34, in run
     self._retval = self.__target(*self.__args, **self.__kwargs)
   File "/usr/lib/python3/dist-packages/apport/ui.py", line 61, in thread_collect_info
     report.add_gdb_info()
   File "/usr/lib/python3/dist-packages/apport/report.py", line 652, in add_gdb_info
     self['CoreDump'].write(f)
   File "/usr/lib/python3/dist-packages/problem_report.py", line 75, in write
     block = gz.read(1048576)
   File "/usr/lib/python3.2/gzip.py", line 343, in read
     self._read(readsize)
   File "/usr/lib/python3.2/gzip.py", line 405, in _read
     self._read_eof()
   File "/usr/lib/python3.2/gzip.py", line 437, in _read_eof
     crc32 = read32(self.fileobj)
   File "/usr/lib/python3.2/gzip.py", line 37, in read32
     return struct.unpack("<I", input.read(4))[0]
 struct.error: unpack requires a bytes object of length 4

It seems that apport showed up and started reporting the bug while the crash file (apt-xapian-index in this case) was not completely written to disk.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :
description: updated
Changed in apport (Ubuntu):
importance: Undecided → High
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in apport (Ubuntu):
status: New → Confirmed
Revision history for this message
Sasa Paporovic (melchiaros) wrote :

Hi Jean-Baptiste, hi Brian

I have closed

bug 1017338

as duplicate of this one, because the stacktraces are the same(the line numbers only differes a little bit).

When I am not completly out of scope(hope not so) than this shows that arround 50 people are affected with this.

Revision history for this message
Sasa Paporovic (melchiaros) wrote :

This causes the apport error (identified only by gtk popup) for me.

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

This looks sort of like this upstream bug:

http://bugs.python.org/issue14315

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

Some of the comments in the duplicate indicate that this happened on the first boot after performing a distribution upgrade and that is when I countered an error message regarding 'unpack requires a bytes object of length 4'. Given that those are apport-package failures I don't think it would have to do with add_gdb_info in that particular case.

tags: added: rls-q-incoming
Changed in apport (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
Changed in python:
status: Unknown → New
Revision history for this message
James Hunt (jamesodhunt) wrote :

Just got this error when manually running apport-bug on 2 crash files generated in a raring -> saucy dist upgrade confirming #6. No apport backtrace but apport shows the following in the terminal:

ERROR: error('unpack requires a bytes object of length 4',)

(apport-gtk:3903): Gtk-CRITICAL **: gtk_main_quit: assertion 'main_loops != NULL' failed

... and the following on the gtk window:

An error occurred while attempting to process this problem report:

unpack requires a bytes object of length 4

Martin Pitt (pitti)
Changed in apport (Ubuntu):
assignee: Martin Pitt (pitti) → nobody
Changed in python:
status: New → Fix Released
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

This release of Ubuntu is no longer receiving maintenance updates. If this is still an issue on a maintained version of Ubuntu please let us know.

Changed in apport (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

This issue has sat incomplete for more than 60 days now. I'm going to close it as invalid. Please feel free re-open if this is still an issue for you. Thank you.

Changed in apport (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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