~mgedmin/apport/fix-lp1453011

  • Committer: Marius Gedminas
  • Date: 2015-05-08 08:04:32 UTC
  • Revision ID: marius@gedmin.as-20150508080432-lq8pv6kdgzudifi8
Don't let gdb's stderr interfere with apport's spliting logic

I noticed that _command_output() was used in only one place in the codebase, so
I took the liberty of removing unused arguments and changing the API to return
stdout and strerr separately (and, also, decoded into Unicode).

I don't know if the truncated core file warning shows up in stdout or stderr,
so I made the parser expect it in either.

I also made apport notice when the splitting logic goes wrong and append an

  UnreportableReason: Couldn't split gdb's output correctly (got N parts instead of M)

I didn't make it raise because then there's no chance to see how the splitting
went wrong, and now we can at least find some interesting bits of information
in unrelated fields.

I don't know if UnreportableReason is the right field to use.

I think maybe it would be good to attach any leftover parts (if there are any,
which would happen if gdb happened to print $n = -99 for some reason in the
middle of one of the parts) into a new field, but I couldn't come up with a
name.  Also note that old code would've raised an IndexError: pop from an empty
list in this case, but I changed it to use zip() so now the report will
proceed, ignoring any extra parts.

This ought to fix https://bugs.launchpad.net/ubuntu/+source/apport/+bug/1453011,
but I'm not sure how to test it.
Filename Latest Rev Last Changed Committer Comment Size
..
apport 359 17 years ago martin at piware * Add apport/python_hook.py: Default exception han Diff
backends 427.1.2 17 years ago martin at piware add backends/dpkg.py: dpkg implementation of abstr Diff
bin 358 17 years ago martin at piware * Move scripts to bin/ in source package. Diff
data 1482 14 years ago Martin Pitt throw away complicated and incomplete build system Diff
doc 559 17 years ago Martin Pitt * Add doc/package-hooks.txt: Document per-package Diff
etc 1354 15 years ago Martin Pitt Move cron.daily, init script, and default file fro Diff
gtk 57 17 years ago martin at piware add initial GTK frontend bits: glade file, icon, s Diff
java 1742.1.1 14 years ago Matt Zimmerman Initial implementation of Java crash handling jav Diff
kde 1466.1.1 14 years ago Richard A. Johnson * Added apport-kde which is a PyKDE4 app that int Diff
man 250 17 years ago martin at piware * Add manpages for apport-retrace(1) and apport-un Diff
pm-utils 1647 14 years ago Martin Pitt Add pm-utils hook to record current operation, so Diff
po 68 17 years ago martin at piware gtk: i18ned Diff
test 1483 14 years ago Martin Pitt Move all test scripts into test/, to unclutter sou Diff
udev 2778 10 years ago Martin Pitt * Add KernelCrash reports when iwlwifi encounters Diff
xdg-mime 902 16 years ago martin at piware * Add xdg-mime/apport.xml: XDG MIME type definitio Diff
.bzrignore 1976 12 years ago Martin Pitt add po/apport.pot, for LP imports 85 bytes Diff Download File
apport_python_hook.py 2787 10 years ago Martin Pitt * Delay the import of the glob and re modules in t 7.3 KB Diff Download File
AUTHORS 2055 12 years ago Martin Pitt README: Update command for one-time enablement. 859 bytes Diff Download File
COPYING 427 17 years ago martin at piware * Add ./COPYING: GPL license. 17.5 KB Diff Download File
File do-release 2945 9 years ago Martin Pitt * do-release: Force UTC timezone for upstream chan 877 bytes Diff Download File
NEWS 2955 8 years ago Martin Pitt * signal_crashes test: Fix test_crash_setuid_* to 111 KB Diff Download File
problem_report.py 2912 9 years ago Martin Pitt * ProblemReport: Set a timestamp of 0 in gzip comp 25.3 KB Diff Download File
README 2172 12 years ago Martin Pitt README: Fix typo 3 KB Diff Download File
setup.cfg 2906.1.1 9 years ago Aron Xu Set translation domain Without domain=apport in s 27 bytes Diff Download File
File setup.py 2904 9 years ago Martin Pitt * Don't install the test suite any more, to save 1 4.7 KB Diff Download File
TODO 2638 10 years ago Martin Pitt drop implemented TODO item 464 bytes Diff Download File
File use-local 2747 10 years ago Martin Pitt Add support for PID namespaces (Linux containers) 365 bytes Diff Download File