Browse files

lib: internal: nativeresolver: solution: SolutionStorage: __update_br…

…oken_successors: fixed possible double-adding

In extremely rare but happened in practice cases, if there is a pair of
supplementary half-circular-dependencies in couple of releases without a
fully circular dependency in any of releases (for example A->B in
squeeze and B->A in wheezy, but nor A->A or B->B in either of them;
practical example: perl-modules&libclass-isa-perl), the algorithm in
__update_broken_successors() incorrectly adds the dependency relation
twice which breaks the invariant.

Releases themselves are not important, any very unlucky pair of available
versions of two packages with properties above will cause this.

Handle this corner case by not considering in the second adding loop
elements which were considered (successfully or not) in the first adding
  • Loading branch information...
Eugene V. Lyubimkin
Eugene V. Lyubimkin committed Aug 13, 2012
1 parent b5a6d6f commit a1c973913b6ffe0bbb95817e7434e676af411bf7
Showing with 1 addition and 0 deletions.
  1. +1 −0 cpp/lib/src/internal/nativeresolver/solution.cpp
@@ -302,6 +302,7 @@ void SolutionStorage::__update_broken_successors(Solution& solution,
for (auto predecessorElementPtr: predecessorsOfOld)
if (isPresent(predecessorsOfNew, predecessorElementPtr)) continue;
+ if (isPresent(successorsOfNew, predecessorElementPtr)) continue;
if (reverseDependencyExists(predecessorElementPtr))

0 comments on commit a1c9739

Please sign in to comment.