#792088 apt-get install segfaults with certain repository configurations

Package:
apt
Source:
apt
Description:
commandline package manager
Submitter:
Rich Ercolani
Date:
2015-07-11 05:24:03 UTC
Severity:
important
#792088#5
Date:
2015-07-11 05:00:29 UTC
From:
To:
Dear Maintainer,
I tried adding the Mono third-party repositories and doing an
"apt-get update; apt-get install -y mono-runtime"

apt-get install mono-runtime refused with an unmet dependency, which I
include below only because of what happened after that:

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 monodoc-http : Depends: mono-xsp4 but it is not going to be installed or
                         mono-apache-server4 but it is not going to be
installed or
                         mono-fastcgi-server4 but it is not going to be
installed
N: Ignoring file 'core' in directory '/etc/apt/sources.list.d/' as it has no
filename extension
N: Ignoring file 'core' in directory '/etc/apt/sources.list.d/' as it has no
filename extension
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused
by held packages.

So I tried "apt-get install mono-runtime monodoc-http", to see what would
result.

Reading package lists... Done
Building dependency tree
Reading state information... Done
monodoc-http is already the newest version.
monodoc-http set to manually installed.
Segmentation fault (core dumped)

I tried bumping from 1.0.9.8 to the testing version (1.0.9.10), behavior
persists.

I can include the core dump and any additional information that would be
useful.

#792088#10
Date:
2015-07-11 05:20:27 UTC
From:
To:
As a bonus, here's a partial stacktrace, with apt rebuilt with nostrip:

#0  0x00007f75d1e05b10 in vtable for pkgDepCache () from
/usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12
#1  0x00007f75d205fda9 in pkgCache::Iterator<pkgCache::Package,
pkgCache::PkgIterator>::end (this=0x7fff16a97660) at
../build/include/apt-pkg/cacheiterators.h:64
#2  0x00007f75d1b33749 in pkgDepCache::IsModeChangeOk
(this=0x7f75d39c04a0, mode=pkgDepCache::ModeKeep, Pkg=..., Depth=0,
FromUser=false) at /root/apt-1.0.9.10/apt-pkg/depcache.cc:918
#3  0x00007f75d1b32e6e in pkgDepCache::MarkKeep (this=0x7f75d39c04a0,
Pkg=..., Soft=false, FromUser=false, Depth=0) at
/root/apt-1.0.9.10/apt-pkg/depcache.cc:769
#4  0x00007f75d1b2d5e4 in pkgProblemResolver::ResolveInternal
(this=0x7f75d3a6d5a0, BrokenFix=true) at
/root/apt-1.0.9.10/apt-pkg/algorithms.cc:1061
#5  0x00007f75cefbf258 in ?? ()
#6  0x00007f75d39c0ce0 in ?? ()
#7  0x0000000000000000 in ?? ()

valgrind helpfully reports:
==1801== Use of uninitialised value of size 8
==1801==    at 0x131D9D: pkgCache::Iterator<pkgCache::Package,
pkgCache::PkgIterator>::end() const (in /usr/bin/apt-get)
==1801==    by 0x4F90748:
pkgDepCache::IsModeChangeOk(pkgDepCache::ModeList,
pkgCache::PkgIterator const&, unsigned long, bool) (depcache.cc:918)
==1801==    by 0x4F8FE6D: pkgDepCache::MarkKeep(pkgCache::PkgIterator
const&, bool, bool, unsigned long) (depcache.cc:769)
==1801==    by 0x4F8A5E3: pkgProblemResolver::ResolveInternal(bool)
(algorithms.cc:1061)
==1801==    by 0x7BF2257: ??? (in /var/cache/apt/pkgcache.bin)
==1801==
==1801==
==1801== Process terminating with default action of signal 11
(SIGSEGV): dumping core
==1801==  Bad permissions for mapped region at address 0x5262B10
==1801==    at 0x5262B10: vtable for pkgDepCache (in
/usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12.0)
==1801==    by 0x4F90748:
pkgDepCache::IsModeChangeOk(pkgDepCache::ModeList,
pkgCache::PkgIterator const&, unsigned long, bool) (depcache.cc:918)
==1801==    by 0x4F8FE6D: pkgDepCache::MarkKeep(pkgCache::PkgIterator
const&, bool, bool, unsigned long) (depcache.cc:769)
==1801==    by 0x4F8A5E3: pkgProblemResolver::ResolveInternal(bool)
(algorithms.cc:1061)
==1801==    by 0x7BF2257: ??? (in /var/cache/apt/pkgcache.bin)



- Rich