apport-retrace uses system package lists which may return a different source package for a binary

Bug #1336062 reported by Brian Murray
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Fix Released
Undecided
Brian Murray

Bug Description

I was trying to retrace a whoopsie crash from Utopic and ran into the following error:

ubuntu@juju-openstack-machine-11:~$ sudo PYTHONPATH=$PYTHONPATH:/srv/daisy.staging.ubuntu.com/production/apport python3 /srv/daisy.staging.ubuntu.com/production/apport/bin/apport-retrace /home/ubuntu/_usr_bin_whoopsie.109.crash -c -S /srv/daisy.staging.ubuntu.com/production/daisy/retracer/config --sandbox-dir /srv/daisy.staging.ubuntu.com/production/cache/Ubuntu\ 14.10/cache-DhmXbj/sandbox -C /srv/daisy.staging.ubuntu.com/pro
duction/cache/Ubuntu\ 14.10/cache-DhmXbj/cache -o /tmp/_usr_bin_whoopsie.109.crash.updated
WARNING: /usr/lib/arm-linux-gnueabihf/libgio-2.0.so.0.4101.0 is needed, but cannot be mapped to a package
WARNING: /usr/lib/arm-linux-gnueabihf/libgobject-2.0.so.0.4101.0 is needed, but cannot be mapped to a package
WARNING: /usr/lib/arm-linux-gnueabihf/libgmodule-2.0.so.0.4101.0 is needed, but cannot be mapped to a package
WARNING: /lib/arm-linux-gnueabihf/libglib-2.0.so.0.4101.0 is needed, but cannot be mapped to a package
WARNING: /usr/lib/arm-linux-gnueabihf/libtasn1.so.6.2.3 is needed, but cannot be mapped to a package
Installing extra package whoopsie to get ExecutablePath
E: Ignore unavailable version '0.2.33' of package 'whoopsie'
E: Unable to find a source package for whoopsie-daisy

I'm guessing its because the whoopsie package changed names from precise to trusty and apport does a source package look up in the host (not sandbox) environment.

Related branches

Revision history for this message
Brian Murray (brian-murray) wrote :

This simple change to a test will exhibit the cause of the failure:

 $ bzr diff test/test_backend_apt_dpkg.py
=== modified file 'test/test_backend_apt_dpkg.py'
--- test/test_backend_apt_dpkg.py 2014-04-30 14:27:45 +0000
+++ test/test_backend_apt_dpkg.py 2014-07-10 19:34:40 +0000
@@ -168,6 +168,7 @@
         self.assertEqual(impl.get_file_package('/bin/bash'), 'bash')
         self.assertEqual(impl.get_file_package('/bin/cat'), 'coreutils')
         self.assertEqual(impl.get_file_package('/etc/blkid.tab'), 'libblkid1')
+ self.assertEqual(impl.get_file_package('/usr/bin/whoopsie'), 'whoopsie-daisy')
         self.assertEqual(impl.get_file_package('/nonexisting'), None)

     def test_get_file_package_uninstalled(self):

Running the test on a 14.04 system fails (this is the opposite of the description where retracing failed on a 12.04 system because we were trying to install whoopsie-daisy in a Utopic sandbox but the cause is the same) with the following error:

 $ PYTHON=python3 test/run backend_apt_dpkg.test_get_file_package
Testing local source tree.
Running pep8...
Running pyflakes...
--- Testing backend_apt_dpkg.test_get_file_package ---
test_get_file_package (__main__.T)
get_file_package() on installed files. ... FAIL

======================================================================
FAIL: test_get_file_package (__main__.T)
get_file_package() on installed files.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_backend_apt_dpkg.py", line 171, in test_get_file_package
    self.assertEqual(impl.get_file_package('/usr/bin/whoopsie'), 'whoopsie-daisy')
AssertionError: 'whoopsie' != 'whoopsie-daisy'
- whoopsie
+ whoopsie-daisy
? ++++++

This is because get_file_package first checks in '/var/lib/dpkg/info/*.list' and returns information from the host system and not in map_cachedir.

Changed in apport (Ubuntu):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Brian Murray (brian-murray)
summary: - apport-retrace on precise confused by source package name changing
+ apport-retrace uses system package lists which may return a different
+ source package for a binary
Revision history for this message
Martin Pitt (pitti) wrote :

Fixed in trunk r2818. I also rolled this out to the Launchpad retracer machines, so it's active there.

Thanks Brian!

Changed in apport (Ubuntu):
importance: High → Undecided
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
apport (2.14.5-0ubuntu1) utopic; urgency=medium

  * New upstream bug fix release. Changes since last snapshot:
    - apt/dpkg get_file_package(): If checking for uninstalled packages, don't
      use package information from the host system, but always look it up in
      the correct indexes. Otherwise this returns wrong results when files
      move to a different package between releases. Thanks Brian Murray!
      (LP: #1336062)
    - apt/dpkg install_packages(): Disable fetching apt translation indexes,
      to save some bandwidth.
    - whoopsie-upload-all: Ignore crash reports with incomplete core dumps
      instead of crashing on them. Thanks Brian Murray. (LP: #1329520)
    - etc/default/apport: Fix comment to use "service" instead of calling the
      init.d script directly.
    - whoopsie-upload-all: Collect hooks information to gather ApportVersion,
      NonfreeKernelModules, and SystemImageInfo. Do this before collecting
      package data to minimize hook run time. (LP: #1349579)
    - Adjust report.test_get_logind_session test to work with systemd >= 205.
    - Fix report.test_check_interpreted_twistd test to skip instead of fail if
      twisted is not installed.

  * Drop automatix.py general hook. Automatix is long gone.
  * etc/apport/blacklist.d/apport: Drop long obsolete npviewer/npplayer
    entries.
  * Drop unnecessary python-gi build dependency.
  * Drop python-twisted-core build dependency. It's just used for one test,
    and will still run in autopkgtest. (Avoids current twisted
    uninstallability in main)
 -- Martin Pitt <email address hidden> Tue, 29 Jul 2014 12:26:23 +0200

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.