← Back to team overview

desktop-packages team mailing list archive

[Bug 865199] Re: apport crashes when /etc/apport/native-origins.d contains any files.

 

This bug was fixed in the package apport - 1.23-0ubuntu4

---------------
apport (1.23-0ubuntu4) oneiric-proposed; urgency=low

  * apport-gtk: In bug update mode, make details dialog resizable and fix
    default size. Patch cherry-picked from trunk r1991. (LP: #865754)
  * backends/packaging-apt-dpkg.py: Fix crash when
    /etc/apport/native-origins.d contains any files. Patch cherry-picked from
    trunk r1973. (LP: #865199)
  * apport/report.py: Special-case crashes of 'twistd': Try to determine the
    client program and assign the report to that, or fail with an
    UnreportableReason. Patch cherry-picked from trunk r1989. (LP: #755025)
  * hookutils.py, attach_wifi(): Anonymize ESSID and AP MAC from "iwconfig"
    output. Patch cherry-picked from trunk 1993. (LP: #746900)
 -- Martin Pitt <martin.pitt@xxxxxxxxxx>   Thu, 20 Oct 2011 12:08:11 +0200

** Changed in: apport (Ubuntu Oneiric)
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to apport in Ubuntu.
https://bugs.launchpad.net/bugs/865199

Title:
  apport crashes when /etc/apport/native-origins.d contains any files.

Status in “apport” package in Ubuntu:
  Fix Released
Status in “apport” source package in Oneiric:
  Fix Released

Bug description:
    File "/usr/lib/python2.6/dist-packages/apport/REThread.py", line 34, in run
      self._retval = self.__target(*self.__args, **self.__kwargs)
    File "/usr/lib/python2.6/dist-packages/apport/ui.py", line 84, in thread_collect_info
      not apport.packaging.is_distro_package(report['Package'].split()[0])) \
    File "/usr/lib/python2.6/dist-packages/apport/packaging_impl.py", line 134, in is_distro_package
      for line in open(f):
  IOError: [Errno 2] Datei oder Verzeichnis nicht gefunden: 'firefox'

  A short look at the source shows that os.listdir is used, but the
  directory path is not joined onto the open:

          try:
              for f in os.listdir('/etc/apport/native-origins.d'):
                  for line in open(f):
                      line = line.strip()
                      if line:
                          native_origins.append(line)
          except OSError:
              pass

  Now, this is wrong on a number of issues:
  os.listdir returns only the basenames => so you need open(os.path.join("/etc/apport/native-origins.d", f))
  Furthermore, open raises an IOError, so the OSError only catches issues with os.listdir, so if it should cover the open too, it should be: except (OSError, IOError): # notice the tuple.

  Alternatively you can also use glob.glob("/etc/apport/native-
  origins.d/*"), that one includes the given path.

  Package version: 1.13.3-0ubuntu2
  Description:	Ubuntu 10.04.3 LTS
  Release:	10.04

  Expected behaviour: Bug reporter should not crash.
  What happened: apport crashed with a traceback.

  I can also provide a fix as a patch if needed, but it's rather a
  trivial thing, packaging it up as a new package is probably more work,
  the detailed description how to fix is above.

  Thanks, Andreas

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apport/+bug/865199/+subscriptions