[Aptitude-devel] Bug#866974: Patch fixing 'Assertion "resman->resolver_exists()" failed.'

Ahzo ahzo at tutanota.com
Sat Sep 19 21:59:40 BST 2020


Control: tag -1 + patch

Hi,

the failure can be reliably reproduced with both the CLI (fatal exception) and the TUI (assertion failure) in a minimal chroot:
# apt install aptitude equivs apt-utils
# cd /tmp && mkdir test
# cat <<EOF > test/test-a1.ctl
Package: test-a
Version: 1
Description: test package a
EOF
# cat <<EOF > test/test-b1.ctl
Package: test-b
Version: 1
Provides: test-provide (= 1)
Description: test package b
EOF
# cat <<EOF > test/test-a2.ctl
Package: test-a
Version: 2
Breaks: test-provide (<< 2)
Description: test package a
EOF
# mkdir build && cd build
# for ctl in ../test/*.ctl; do equivs-build "$ctl"; done; cd ..
# mkdir test-repo1; mv build/*1*.deb test-repo1
# cd test-repo1; apt-ftparchive packages ./ > Packages; cd ..
# mkdir test-repo2; mv build/*2*.deb test-repo2
# cd test-repo2; apt-ftparchive packages ./ > Packages; cd ..
# cat <<EOF >> /etc/apt/sources.list
deb [ trusted=yes ] file:/tmp/test-repo1 ./
EOF
# apt update
# apt install test-a test-b
# sed -i 's/repo1/repo2/' /etc/apt/sources.list
# apt update
# # Reproduces problem with CLI:
# aptitude upgrade
The following packages will be upgraded:
  test-a{b}
1 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/2164 B of archives. After unpacking 0 B will be used.
The following packages have unmet dependencies:
test-a : Breaks: test-provide (< 2) which is a virtual package, provided by:
                  - test-b (1), but 1 is installed

*** ERROR: search aborted by fatal exception.  You may continue
           searching, but some solutions will be unreachable.

I want to resolve dependencies, but no dependency resolver was created.The following packages will be upgraded:
  test-a{b}
1 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/2164 B of archives. After unpacking 0 B will be used.
aptitude failed to find a solution to these dependencies.  You can solve them yourself by hand or type 'n' to quit.
The following packages have unmet dependencies:
test-a : Breaks: test-provide (< 2) which is a virtual package, provided by:
                  - test-b (1), but 1 is installed

Resolve these dependencies by hand? [N/+/-/_/:/?]
# # Reproduce problem with TUI:
# apt full-upgrade
# sed -i 's/repo2/repo1/' /etc/apt/sources.list
# apt update
# aptitude    # select 'test-b' for installation, press g
Uncaught exception: ../../src/ui.cc:1549: void auto_fix_broken(): Assertion "resman->resolver_exists()" failed.


The problem is that aptitude explicitly ignores provides when trying to find solutions for versioned Breaks/Conflicts.
Thus it proposes a "solution" that actually does not resolve the dependencies, as aptitude later notices, hence the fatal exception/assertion failure.

Attached is a patch which fixes the problem by removing two checks for !TargetVer() in the resolver code responsible for examining Provides.
It seems as if these were overlooked, when introducing support for versioned provides.

I've also attached a patch fixing the missing newline, as suggested by 積丹尼 Dan Jacobson.

Regards,
Ahzo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-cmdline-Add-missing-newline-in-error-message.patch
Type: text/x-patch
Size: 1054 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/aptitude-devel/attachments/20200919/0e35e31d/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-resolver-support-breaks-and-conflicts-on-versioned-p.patch
Type: text/x-patch
Size: 1972 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/aptitude-devel/attachments/20200919/0e35e31d/attachment-0003.bin>


More information about the Aptitude-devel mailing list