infinite loop if deborphan returns packages that are not installed

Bug #940374 reported by Jean-Baptiste Lallement
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
upgrade-system (Ubuntu)
Fix Released
Undecided
Unassigned
Precise
Fix Released
High
Unassigned

Bug Description

On my system, for some reason which looks like a bug in deborphan, deborphan returns packages that are not installed on the system - dpkg status is 'un' .

In this situation upgrade-system enters in an infinite loop when it purges orphan packages.

TEST CASE:
1. On an amd64 host, install a non-essential library for a foreign architecture and make sure that it is not already installed for the native architecture.
  $ sudo apt-get install libodbc1:i386
2. Verify that deborphan lists the package:
  $ sudo deborphan
3. Run upgrade-system
  $ sudo upgrade-system

ACTUAL RESULT:
$ deborphan
libodbc1
Note that the arch is not displayed. upgrade-system tries to remove the amd64 version of the package resulting in a loop.

EXPECTED RESULT:
i386 is listed and purged (Bug #940379) or at least upgrade-system breaks from the loop

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: upgrade-system 1.5.1.0
ProcVersionSignature: Ubuntu 3.2.0-17.26-generic 3.2.6
Uname: Linux 3.2.0-17-generic x86_64
NonfreeKernelModules: fglrx
ApportVersion: 1.93-0ubuntu2
Architecture: amd64
Date: Fri Feb 24 16:09:28 2012
GsettingsChanges:
 com.ubuntu.update-manager check-new-release-ignore 'oneiric'
 com.ubuntu.update-manager first-run false
 com.ubuntu.update-manager launch-time 1326868847
PackageArchitecture: all
ProcEnviron:
 TERM=xterm
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: upgrade-system
UpgradeStatus: Upgraded to precise on 2012-01-31 (23 days ago)

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :
summary: - infinite loop if deborphan returns already removed packages
+ infinite loop if deborphan returns packages that are not installed
Revision history for this message
Martin-Éric Racine (q-funk) wrote :

Pretty strange, since upgrade-system checks error codes and exits if something suspicious is found. I'm wondering if I should add another error checking step somewhere. Any suggestion?

Btw, should this bug be cloned as affecting deborphan too?

Revision history for this message
Martin-Éric Racine (q-funk) wrote :

Would the attached change work to at least escape deborphan bugs and exit upgrade-system? Here, I've never had any false positive reported by deorphan, so I'm unable to test for the case that you're seeing, but it seems like this might work.

Revision history for this message
Martin-Éric Racine (q-funk) wrote :

Bug #940379 tracks the "deborphan" issue, which might be caused by "dpkg" inconsistencies after all.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

The patch doesn't fix the problem, return code is always 0.
execution log attached.

description: updated
Revision history for this message
Martin-Éric Racine (q-funk) wrote :

Apparently, deborphan has been fixed to support multiarch and is pending upload at Debian.

Revision history for this message
Martin-Éric Racine (q-funk) wrote :

After talking with the 'deborphan' maintainer, it appears that fixing this issue would require uploading a newer 'deborphan' and a newer 'synaptics' (which depends upon specific deborphan features and fails with multiarch packages in a way similar to upgrade-system) to Precise-updates. In both cases, the idea is to implement explicit support for multiarch results returned by dpkg. Alternately, a kludge has been invented for 'upgrade-system' (see attached patch) which could be uploaded to Precise. However, the same issue affects synaptics as well, so perhaps it would be more desirable to upload fixed versions of deborphan and synaptics to precise-updates, since upgrade-system itself is totally agnostic to how dpkg/deborphan/apt perform under the hood.

For Quantal and newer releases, the issue will resolve itself magicaly, since more recent dpkg/deborphan/synpatics featuring the final i.e. non-WIP version of multiarch support will be imported from Debian.

tags: added: patch
Revision history for this message
Brian Murray (brian-murray) wrote : Missing SRU information

Thanks for uploading the fix for this bug report to -proposed. However, when reviewing the package in -proposed and the details of this bug report I noticed that the bug description is missing information required for the SRU process. You can find full details at http://wiki.ubuntu.com/StableReleaseUpdates#Procedure but essentially this bug is missing some of the following: a statement of impact, a test case and details regarding the regression potential. Thanks in advance!

Changed in upgrade-system (Ubuntu Precise):
status: New → Fix Committed
importance: Undecided → High
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "upgrade-system_kludge_for_Precise.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package upgrade-system - 1.6.2.0

---------------
upgrade-system (1.6.2.0) unstable; urgency=low

  * Merged a kludge to escape 'deborphan' loops whenever running on a
    multiarch host without multiarch-aware deborphan. Such a mismatch
    between apt/dpkg/deborphan features only ever happened in Ubuntu/
    Precise, but the deborphan maintainer nonetheless feels it should
    be safeguarded against just in case (LP: #940374).
  * FLAUSCH: removed 'deborphan --find-config' loop; our loop to find
    partially-removed packages already does this using 'dpkg-query'.
  * upgrade-system: converted every command to use --long-options.

 -- Martin-Éric Racine <email address hidden> Mon, 11 Jun 2012 16:28:44 +0300

Changed in upgrade-system (Ubuntu):
status: New → Fix Released
Revision history for this message
Martin-Éric Racine (q-funk) wrote :

Brian, I beleive that Jean-Baptise already did a rather good job of outlining the issue and its test case.

As for regression potential, there isn't any that I can think of. The scope of this change being rather small, I cannot think of anything else to add.

Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello Jean-Baptiste, or anyone else affected,

Accepted upgrade-system into precise-proposed. The package will build now and be available in a few hours. Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users. If this package fixes the bug for you please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case details of your testing will help us make a better decision. Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed
Revision history for this message
Steve Langasek (vorlon) wrote :

I've verified this fix using the test case provided. Thanks!

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package upgrade-system - 1.6.1.0+precise1

---------------
upgrade-system (1.6.1.0+precise1) precise-proposed; urgency=low

  * Merged a kludge to escape 'deborphan' loops whenever running on a
    multiarch host without multiarch-aware deborphan. Such a mismatch
    between APT/dpkg/deborphan features only ever happened in Ubuntu/
    Precise, but the deborphan maintainer nonetheless feels it should
    be safeguarded against just in case (Closes: #672829).
    (LP: #940374)
 -- Martin-Eric Racine <email address hidden> Sat, 09 Jun 2012 14:57:34 +0300

Changed in upgrade-system (Ubuntu Precise):
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.