libapt-pkg regression: infinite loop on processing certain Pre-Depends

Bug #985852 reported by Malcolm Scott
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Summary: a typo in apt-pkg/packagemanager.cc means that certain Pre-Depends cannot be processed, causing libapt-pkg to hang.

Details: I have a custom package whose control file contains
  Pre-Depends: grub-pc | grub
When I attempt to install this on a system which has grub installed already but not grub-pc, apt-get hangs indefinitely, in an infinite loop inside pkgPackageManager::SmartUnPack.

This situation, in which one of the pre-depends is already installed, should be handled in the block starting at apt-pkg/packagemanager.cc:612 ("Look for easy targets: packages that are already okay"). However this fails to inspect anything but the first pre-depend option as line 615 refers to Start rather than Cur (repeatedly looking at the first package in the iterator, not the current value of the iterator).

The error has been replicated a few lines further down, which means the subsequent code also fails to resolve the situation (e.g. in the case that the second pre-depend is simultaneously being installed explicitly).

I attach a debdiff.

Revision history for this message
Malcolm Scott (malcscott) wrote :
Revision history for this message
Malcolm Scott (malcscott) wrote :

I should have said: this bug is in apt 0.8.16~exp12ubuntu9 in precise. This behaviour did not occur in oneiric or any other previous version I have used.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "debdiff" of this bug report has been identified as being a patch in the form of a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. 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-sponsors 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.]

tags: added: patch
Michael Vogt (mvo)
Changed in apt (Ubuntu):
status: New → In Progress
importance: Undecided → High
Michael Vogt (mvo)
Changed in apt (Ubuntu):
milestone: none → precise-updates
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 0.8.16~exp12ubuntu10

---------------
apt (0.8.16~exp12ubuntu10) precise-proposed; urgency=low

  [ Malcolm Scott ]
  * apt-pkg/packagemanager.cc:
    - Fix a regression in the pre-depend handling: where a pre-depend option
      other than the first specified is already installed, apt-get enters an
      infinite loop (LP: #985852)

  [ Michael Vogt ]
  * apt-pkg/packagemanager.cc:
    - add APT::pkgPackageManager::MaxLoopCount to ensure that the
      ordering code does not get into a endless loop when it flip-flops
      between two states

  [ David Kalnischkies ]
  * apt-pkg/cacheset.cc:
    - actually return to the fallback modifier if we have detected we
      should for packagenames which look like modifiers (Closes: #669591)
      LP: #982716
 -- Michael Vogt <email address hidden> Fri, 20 Apr 2012 11:10:12 +0200

Changed in apt (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Malcolm Scott (malcscott) wrote :

Many thanks for getting this fix into precise quickly! Very much appreciated.

Revision history for this message
Malcolm Scott (malcscott) wrote :

Is there any chance this patch could also be applied to release-upgrader-apt in lucid? I'm encountering the same bug on release upgrade from lucid to precise (with the aforementioned custom package installed).

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.