← 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.13.3-0ubuntu2.1

---------------
apport (1.13.3-0ubuntu2.1) lucid-proposed; urgency=low

  * backends/packaging-apt-dpkg.py: Fix crash when
    /etc/apport/native-origins.d contains any files. Fix backported from
    upstream r1973. (LP: #865199)
 -- Martin Pitt <martin.pitt@xxxxxxxxxx>   Wed, 16 Nov 2011 08:10:17 +0100

** Changed in: apport (Ubuntu Lucid)
       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 Lucid:
  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