apport-retrace determines wrong package providing a file with uninstalled==True

Bug #1684117 reported by Benjamin Drung
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Apport
Triaged
Undecided
Unassigned

Bug Description

Assume that you have two packages foo1 and foo2 which provide the binary /usr/bin/foo.

make_sandbox() calls

pkg = apport.packaging.get_file_package(report[path], True, pkgmap_cache_dir,
                                        release=report['DistroRelease'],
                                        arch=report.get('Architecture'))

In this example, report[path] would point to /usr/bin/foo. get_file_package() will return the first package name that it finds. So it might either return foo1 or foo2 which might be the wrong one. get_file_package() should take into account which package is installed instead.

Benjamin Drung (bdrung)
description: updated
Revision history for this message
Martin Pitt (pitti) wrote :

Are you sure that this is the complete invocation? Can you please attach a standalone reproducer?

I see how that could happen if you pass uninstalled=True (it's False by default), as that will grep Contents.gz. But with uninstalled=False it consults dpkg diversions and /var/lib/dpkg/info/*.list, which should always deliver an unique result. So if two *installed* packages ship the same file without using diversions, that is not an apport bug.

The uninstalled=True case needs fixing for this, though. It should call self._search_contents() only if the above did not already find the file, i. e move that bit to the end of the function.

Changed in apport:
status: New → Incomplete
Revision history for this message
Martin Pitt (pitti) wrote :

Nevermind, you do pass uninstalled=True, just not by name.

summary: - apport-retrace determines wrong package providing a file
+ apport-retrace determines wrong package providing a file with
+ uninstalled==True
Changed in apport:
status: Incomplete → Triaged
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.