apport-collect broken (with source pkg name != binary pkg name?)

Bug #993810 reported by David Henningsson on 2012-05-03
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Medium
Martin Pitt
Precise
Undecided
Unassigned

Bug Description

Running apport-collect on a bug against alsa-driver results in the following stack trace. My guess is that this has something to do with that the source package name is "alsa-driver" but there is no binary package with that name (it's named "alsa-base", among others).
Running apport-collect on a bug against "pulseaudio" succeeds. There is both a source and a binary package named "pulseaudio".

No packages found matching alsa-driver.
Traceback (most recent call last):
  File "/usr/share/apport/apport-gtk", line 499, in <lambda>
    GLib.idle_add(lambda: self.collect_info(on_finished=self.ui_update_view))
  File "/usr/lib/python2.7/dist-packages/apport/ui.py", line 867, in collect_info
    icthread.exc_raise()
  File "/usr/lib/python2.7/dist-packages/apport/REThread.py", line 34, in run
    self._retval = self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.7/dist-packages/apport/ui.py", line 74, in thread_collect_info
    report.add_package_info(package)
  File "/usr/lib/python2.7/dist-packages/apport/report.py", line 225, in add_package_info
    self['SourcePackage'] = packaging.get_source(package)
  File "/usr/lib/python2.7/dist-packages/apport/packaging_impl.py", line 116, in get_source
    if self._apt_pkg(package).installed:
  File "/usr/lib/python2.7/dist-packages/apport/packaging_impl.py", line 87, in _apt_pkg
    raise ValueError('package does not exist')
ValueError: package does not exist

trunk fix (with test cases): http://bazaar.launchpad.net/~apport-hackers/apport/trunk/revision/2334

SRU TEST CASE
=============
- Subscribe to a bug which has a "linux" or an "alsa-driver" task. Martin Pitt used bug 973787 and bug 1005849 for testing.
- Run "apport-collect 973787" (or whichever bug you subscribed to)
- In the current precise version you will see a crash traceback and the Apport window stays empty with a spinner.
- With this fixed version there is no crash and the Apport window shows a rich variety of collected information.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: apport 2.0.1-0ubuntu7
ProcVersionSignature: Ubuntu 3.2.0-24.37-generic 3.2.14
Uname: Linux 3.2.0-24-generic x86_64
ApportVersion: 2.0.1-0ubuntu7
Architecture: amd64
CrashReports: 640:1000:114:16647:2012-04-25 17:28:10.236896000 +0200:2012-04-25 17:28:11.236896000 +0200:/var/crash/_usr_bin_rdiff-backup.1000.crash
Date: Thu May 3 10:19:21 2012
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Beta amd64 (20120421)
PackageArchitecture: all
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: apport
UpgradeStatus: No upgrade log present (probably fresh install)

David Henningsson (diwic) wrote :
Martin Pitt (pitti) on 2012-05-03
Changed in apport (Ubuntu):
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Martin Pitt (pitti)
Martin Pitt (pitti) on 2012-05-29
Changed in apport (Ubuntu Precise):
status: New → Triaged
importance: Undecided → Medium
Martin Pitt (pitti) wrote :

Note to self: This has been introduced with the UI rewrite. It seems apport-gtk collects information twice, and the second time the report does not have a ProblemType field any more (run_update_report() deletes it as it is not relevant for this operation).

Martin Pitt (pitti) on 2012-05-30
description: updated
Martin Pitt (pitti) on 2012-05-30
description: updated
Changed in apport (Ubuntu):
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.1.1-0ubuntu1

---------------
apport (2.1.1-0ubuntu1) quantal; urgency=low

  [ Martin Pitt ]
  * debian/control: Update Vcs-Bzr: for quantal branch.
  * data/general-hooks/ubuntu.py: Do not assume that all reports have a
    ProblemType field. This will not be the case for updating a bug with
    "apport-collect". (LP: #1004029)
  * New upstream release:
    - launchpad.py: When closing a bug as a duplicate, copy some well-known
      tags to the master bug. Thanks Brian Murray.
    - launchpad.py: Set importance of Python crash reports to "Medium" by
      default, similar to signal crashes. Thanks Brian Murray.
    - hookutils.py: Add attach_default_grub() convenience function from the
      grub2 package hook so it can be used by other packages. Thanks Brian
      Murray.
    - launchpad.py: Make Launchpad bug subscription user/team configurable:
      The initial subscriber after filing a bug can be set with the
      "initial_subscriber" crashdb option, and the team which gets subscribed
      after retracing with "triaging_team". (LP: #980726)
    - report.py: Do not change the SourcePackage: field if the binary package
      is not installed and does not exist. This fixes source package hooks to
      actually work in some cases where source and binary package names
      overlap. (part of LP: #993810)
    - apport-gtk, apport-kde: Avoid collecting information twice in "bug
      update" mode. This caused a crash in cases where the source package in a
      bug report does not correspond to an installed binary package.
      (LP: #993810)

  [ Brian Murray ]
  * data/general-hooks/ubuntu.py: block reporting of package install failures
    with error regarding 'not a debian format archive'
 -- Martin Pitt <email address hidden> Wed, 30 May 2012 09:06:49 +0200

Changed in apport (Ubuntu):
status: Fix Committed → Fix Released
Martin Pitt (pitti) wrote :

Uploaded to precise-proposed queue, needs ~ubuntu-sru review.

Changed in apport (Ubuntu Precise):
importance: Medium → Undecided
status: Triaged → Fix Committed

Hello David, or anyone else affected,

Accepted apport into precise-proposed. The package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
David Henningsson (diwic) wrote :

Hi, I've tested it according to the "SRU TEST CASE" above and I confirm that the stack trace is now gone and that the collected information screen is shown instead.

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 2.0.1-0ubuntu11

---------------
apport (2.0.1-0ubuntu11) precise-proposed; urgency=low

  * data/package-hooks/source_linux.py: If we report against an -lts-quantal
    source package, move the source to "linux" and add a qa-kernel-lts-testing
    tag, as per kernel team request in LP: #1004101 . Add source package hook
    symlinks for source_linux-{,meta-}lts-quantal.py to source_linux.py.
  * data/apport: apport: Also treat a binary as modified if the /proc/pid/exe
    symlink does not point to an existing file any more. Backported from trunk
    r2406. (LP: #984944)

apport (2.0.1-0ubuntu10) precise-proposed; urgency=low

  * debian/apport.install: Actually ship the native-origins.d directory, so
    that the previous bug fix for LP: #1004101 actually works.

apport (2.0.1-0ubuntu9) precise-proposed; urgency=low

  [ Martin Pitt ]
  * data/apport: Ignore a crash if the executable was modified after the
    process started. This often happens if the package is upgraded and a
    long-running process is not stopped before. Patch cherry-picked from trunk
    r2296. (LP: #984944)
  * Add etc/apport/native-origins.d/lts-q-backports: Accept
    ppa:ubuntu-x-swat/q-lts-backport as official Ubuntu package repository, so
    that users can report bugs and crashes against the backported kernel and
    X.org stack. (LP: #1004101)
  * data/general-hooks/ubuntu.py: Do not assume that all reports have a
    ProblemType field. This will not be the case for updating a bug with
    "apport-collect". (LP: #1004029)
  * report.py: Do not change the SourcePackage: field if the binary package is
    not installed and does not exist. This fixes source package hooks to
    actually work in some cases where source and binary package names overlap.
    Patch cherry-picked from trunk r2332. (part of LP: #993810)
  * apport-gtk, apport-kde: Avoid collecting information twice in "bug update"
    mode. This caused a crash in cases where the source package in a bug
    report does not correspond to an installed binary package. Patch
    cherry-picked from trunk r2334. (LP: #993810)

  [ Brian Murray ]
  * data/general-hooks/ubuntu.py: block reporting of package install failures
    with error regarding 'not a debian format archive'. (LP: #1002535)
 -- Martin Pitt <email address hidden> Thu, 28 Jun 2012 09:01:41 +0200

Changed in apport (Ubuntu Precise):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers