[Bug 985852] [NEW] libapt-pkg regression: infinite loop on processing certain Pre-Depends

Malcolm Scott launchpad at malc.org.uk
Thu Apr 19 19:47:19 UTC 2012


Public bug reported:

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.

** Affects: apt (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: regression

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apt in Ubuntu.
https://bugs.launchpad.net/bugs/985852

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

Status in “apt” package in Ubuntu:
  New

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/985852/+subscriptions




More information about the foundations-bugs mailing list