[Bug 865199] Re: apport crashes when /etc/apport/native-origins.d contains any files.
mikewhatever
865199 at bugs.launchpad.net
Wed Nov 16 08:41:51 UTC 2011
Thanks Martin, really appreciate it.
--
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is subscribed to a duplicate bug report (877848).
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 Committed
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
More information about the Ubuntu-sponsors
mailing list