[Bug 865199] Re: apport crashes when /etc/apport/native-origins.d contains any files.
michael37
865199 at bugs.launchpad.net
Sun Nov 20 03:00:56 UTC 2011
Doesn't seem to work for me as I am still affected by bug 877848 which
is supposedly a duplicate. Lucid 10.04.3 x86_64.
Get:1 http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/ lucid-proposed/main apport 1.13.3-0ubuntu2.1 [54.8kB]
Fetched 54.8kB in 1s (31.5kB/s)
(Reading database ... 204744 files and directories currently installed.)
Preparing to replace apport 1.13.3-0ubuntu2 (using .../apport_1.13.3-0ubuntu2.1_all.deb) ...
$ ubuntu-bug apport
Traceback (most recent call last):
File "/usr/share/apport/apport-gtk", line 368, in <module>
app.run_argv()
File "/usr/lib/python2.6/dist-packages/apport/ui.py", line 553, in run_argv
return self.run_report_bug()
File "/usr/lib/python2.6/dist-packages/apport/ui.py", line 369, in run_report_bug
self.collect_info(symptom_script)
File "/usr/lib/python2.6/dist-packages/apport/ui.py", line 769, in collect_info
icthread.exc_raise()
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] No such file or directory: 'firefox'
--
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