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 on 2012-10-09
90
This bug affects 56 people
Affects Status Importance Assigned to Milestone
Python
Fix Released
Unknown
apport (Ubuntu)
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.

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

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

Changed in apport (Ubuntu):
status: New → Confirmed
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.

Sasa Paporovic (melchiaros) wrote :

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

Brian Murray (brian-murray) wrote :

This looks sort of like this upstream bug:

http://bugs.python.org/issue14315

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
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) on 2013-06-27
Changed in apport (Ubuntu):
assignee: Martin Pitt (pitti) → nobody
Changed in python:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
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.