[Aptitude-devel] Bug#836567: aptitude: [PATCH] aborts on encountering new DepCompareOp flags

Aaron M. Ucko amu at alum.mit.edu
Sun Sep 4 03:35:14 UTC 2016


Package: aptitude
Version: 0.8.3-1
Severity: important
Tags: patch

Aptitude recently started aborting under some circumstances, notably
when asked to calculate safe upgrades on my multiarch-enabled system.
The aborts turned out to occur on line 1182 of src/generic/apt/apt.cc,
with t1 values that didn't match any cases because the ArchSpecific
flag was originally set and never masked out.  I've gotten good
results by masking out *all* high bits when setting t1 and t2, per the
below patch, but haven't examined the code closely enough to be
certain that it's correct or sufficient.

Could you please take a look?

Thanks!

diff --git a/src/generic/apt/apt.cc b/src/generic/apt/apt.cc
index 1850825..c384f9a 100644
--- a/src/generic/apt/apt.cc
+++ b/src/generic/apt/apt.cc
@@ -1141,8 +1141,8 @@ static bool subsumes(const pkgCache::DepIterator &d1,
       if(!d2.TargetVer())
 	return false;
 
-      pkgCache::Dep::DepCompareOp t1 = (pkgCache::Dep::DepCompareOp) (d1->CompareOp &~ pkgCache::Dep::Or);
-      pkgCache::Dep::DepCompareOp t2 = (pkgCache::Dep::DepCompareOp) (d2->CompareOp &~ pkgCache::Dep::Or);
+      pkgCache::Dep::DepCompareOp t1 = (pkgCache::Dep::DepCompareOp) (d1->CompareOp % pkgCache::Dep::Or);
+      pkgCache::Dep::DepCompareOp t2 = (pkgCache::Dep::DepCompareOp) (d2->CompareOp % pkgCache::Dep::Or);
 
       int cmpresult = _system->VS->DoCmpVersion(d1.TargetVer(), d1.TargetVer()+strlen(d1.TargetVer()),
 						d2.TargetVer(), d2.TargetVer()+strlen(d2.TargetVer()));

-- Package-specific info:
Terminal: xterm-256color
$DISPLAY is set.
which aptitude: /home/amu/bin/aptitude

aptitude version information:
aptitude 0.8.3
Compiler: g++ 6.1.1 20160802
Compiled against:
  apt version 5.0.0
  NCurses version 6.0
  libsigc++ version: 2.8.0
  Gtk+ support disabled.
  Qt support disabled.

Current library versions:
  NCurses version: ncurses 6.0.20160625
  cwidget version: 0.5.17
  Apt version: 5.0.0

aptitude linkage:
	linux-vdso.so.1 (0x00007ffe49113000)
	libapt-pkg.so.5.0 => /usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0 (0x00007fa04d947000)
	libncursesw.so.5 => /lib/x86_64-linux-gnu/libncursesw.so.5 (0x00007fa04d717000)
	libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007fa04d4ec000)
	libsigc-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libsigc-2.0.so.0 (0x00007fa04d2e5000)
	libcwidget.so.3 => /usr/lib/x86_64-linux-gnu/libcwidget.so.3 (0x00007fa04cfe8000)
	libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007fa04cce4000)
	libboost_iostreams.so.1.61.0 => /usr/lib/x86_64-linux-gnu/libboost_iostreams.so.1.61.0 (0x00007fa04cacc000)
	libboost_filesystem.so.1.61.0 => /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.61.0 (0x00007fa04c8b3000)
	libboost_system.so.1.61.0 => /usr/lib/x86_64-linux-gnu/libboost_system.so.1.61.0 (0x00007fa04c6ae000)
	libxapian.so.22 => /usr/lib/x86_64-linux-gnu/libxapian.so.22 (0x00007fa04c2aa000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa04c08d000)
	libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fa04bd0b000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa04ba06000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fa04b7f0000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa04b44e000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa04b24a000)
	libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007fa04b033000)
	libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fa04ae17000)
	libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007fa04ac07000)
	liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fa04a9e4000)
	liblz4.so.1 => /usr/lib/x86_64-linux-gnu/liblz4.so.1 (0x00007fa04a7d1000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fa04a5c9000)
	libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007fa04a3c3000)
	/lib64/ld-linux-x86-64.so.2 (0x000055aa2c2b0000)

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable'), (300, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, x32

Kernel: Linux 4.7.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages aptitude depends on:
ii  aptitude-common            0.8.3-1
ii  libapt-pkg5.0              1.3~rc2
ii  libboost-filesystem1.61.0  1.61.0+dfsg-2.1
ii  libboost-iostreams1.61.0   1.61.0+dfsg-2.1
ii  libboost-system1.61.0      1.61.0+dfsg-2.1
ii  libc6                      2.23-5
ii  libcwidget3v5              0.5.17-4+b1
ii  libgcc1                    1:6.1.1-11
ii  libncursesw5               6.0+20160625-1
ii  libsigc++-2.0-0v5          2.8.0-2
ii  libsqlite3-0               3.14.1-1
ii  libstdc++6                 6.1.1-11
ii  libtinfo5                  6.0+20160625-1
ii  libxapian22v5              1.2.23-1

Versions of packages aptitude recommends:
ii  libparse-debianchangelog-perl  1.2.0-10
ii  sensible-utils                 0.0.9

Versions of packages aptitude suggests:
ii  apt-xapian-index                0.48
ii  aptitude-doc-en [aptitude-doc]  0.8.3-1
ii  debtags                         2.1.1
ii  tasksel                         3.35

-- no debconf information



More information about the Aptitude-devel mailing list