Bug#678225: libapt-pkg: Apt and related tools (apt-cache, aptitude, etc.) segfault on reading package lists

June 19th, 2012 - 10:10 pm ET by Sohum Banerjea | Report spam
Package: libapt-pkg4.12
Version: 0.9.6
Severity: important
File: libapt-pkg

Dear Maintainer,

It appears that any apt- activity that depends on reading the package
lists is failing. (aptitude --version doesn't fail, aptitude update,
apt-cache policy, apt-get update, and aptitude show all do fail.)

% gdb $(which aptitude) core [1150.57]
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/aptitude...Reading symbols from /usr/lib/debug/.build-id/49/189d38eb992c3f04ed3a2d33415221f18298e9.debug...done.
done.
[New LWP 18185]

warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `aptitude update'.
Program terminated with signal 11, Segmentation fault.
#0 0x00007ffb22aa4f30 in pkgCacheGenerator::ListParser::NewProvides(pkgCache::VerIterator&, std::string const&, std::string const&, std::string const&) ()
from /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12
(gdb) bt
#0 0x00007ffb22aa4f30 in pkgCacheGenerator::ListParser::NewProvides(pkgCache::VerIterator&, std::string const&, std::string const&, std::string const&) ()
from /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12
#1 0x00007ffb22adc561 in debListParser::NewProvidesAllArch(pkgCache::VerIterator&, std::string const&, std::string const&) () from /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12
#2 0x00007ffb22ade943 in debListParser::ParseProvides(pkgCache::VerIterator&) () from /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12
#3 0x00007ffb22adf57c in debListParser::NewVersion(pkgCache::VerIterator&) () from /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12
#4 0x00007ffb22aa3668 in pkgCacheGenerator::MergeListVersion(pkgCacheGenerator::ListParser&, pkgCache::PkgIterator&, std::string const&, pkgCache::VerIterator*&) ()
from /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12
#5 0x00007ffb22aa48b3 in pkgCacheGenerator::MergeList(pkgCacheGenerator::ListParser&, pkgCache::VerIterator*) () from /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12
#6 0x00007ffb22af7cba in debPackagesIndex::Merge(pkgCacheGenerator&, OpProgress*) const () from /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12
#7 0x00007ffb22a9d892 in ?? () from /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12
#8 0x00007ffb22aa0669 in pkgCacheGenerator::MakeStatusCache(pkgSourceList&, OpProgress*, MMap**, bool) () from /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12
#9 0x00007ffb23160ff4 in aptitudeCacheFile::Open (this=0x7ffb255171f0, Progress=..., do_initselections=false, WithLock=true, status_fname=0x0) at ../../../../src/generic/apt/aptcache.cc:2178
#10 0x00007ffb2316fea7 in apt_load_cache (progress_bar=0x7fffa95c6910, do_initselections=false, status_fname=0x0) at ../../../../src/generic/apt/apt.cc:435
#11 0x00007ffb23116e32 in cmdline_do_download (m=0x7fffa95c6d70, verbose=0, term_input=..., term_locale=..., term_metrics=..., term_output=...) at ../../../src/cmdline/cmdline_util.cc:445
#12 0x00007ffb23113788 in cmdline_update (argc=<optimized out>, argv=<optimized out>, verbose=0) at ../../../src/cmdline/cmdline_update.cc:67
#13 0x00007ffb22fe769b in main (argc=2, argv=0x7fffa95c76f8) at ../../src/main.cc:1114


Debian Release: wheezy/sid
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libapt-pkg4.12:amd64 depends on:
ii libbz2-1.0 1.0.6-3
ii libc6 2.13-33
ii libgcc1 1:4.7.0-8
ii libstdc++6 4.7.0-8
ii multiarch-support 2.13-33
ii zlib1g 1:1.2.7.dfsg-11

libapt-pkg4.12:amd64 recommends no packages.

libapt-pkg4.12:amd64 suggests no packages.




To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
email Follow the discussionReplies 4 repliesReplies Make a reply

Similar topics

Replies

#1 Daniel Hartwig
June 19th, 2012 - 11:00 pm ET | Report spam
severity 678225 normal
merge 674951 678225
affects 674951 aptitude
thanks

On 20 June 2012 09:57, Sohum Banerjea wrote:
Package: libapt-pkg4.12
Version: 0.9.6



Hello

It appears that any apt- activity that depends on reading the package
lists is failing. (aptitude --version doesn't fail, aptitude update,
apt-cache policy, apt-get update, and aptitude show all do fail.)

% gdb $(which aptitude) core



Did this start happening after using aptitude or apt-get to update?

Is it fixed by:

# rm -f /var/cache/apt/*.bin
# apt-get update

Regards



To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
Replies Reply to this message
#2 Daniel Hartwig
June 20th, 2012 - 12:10 am ET | Report spam
On 20 June 2012 11:04, Sohum Banerjea wrote:
Did this start happening after using aptitude or apt-get to update?



I assume after apt-get update, as that's what's in my crontab.

% sudo rm -f /var/cache/apt/*.bin*
% sudo apt-get update
<snip>
Fetched 254 kB in 40s (6,327 B/s)
% echo $?
139



How about after:

# cp -R /var/lib/apt/lists /var/lib/apt/lists.bak
# rm -rf /var/lib/apt/lists/*



To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
Replies Reply to this message
#3 Daniel Hartwig
June 20th, 2012 - 01:00 am ET | Report spam
On 20 June 2012 12:17, Sohum Banerjea wrote:
Yea, switching to a different mirror, then nuking and recreating
/var/lib/apt/lists fixed it. Thank you!



Excellent :-)


Is there anything else I can do to help diagnose the segfault bug?



Certainly, assuming you have not deleted the backup list files:

$ tar caf bug-678225-lists.tar.xz /var/lib/apt/lists.bak/*

Upload that (rather large) file somewhere and email back the link.
This will help someone to debug the segfault.

If you are comfortable using the debugger you could rebuild apt with
DEB_BUILD_OPTIONS="noopt nostrip" and have a go yourself.



To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
Replies Reply to this message
#4 Sohum Banerjea
June 20th, 2012 - 02:10 am ET | Report spam
And I just realised I haven't been replying-to-all.

Short version: my mirrors were borked, apparently. Switching to a
different mirror fixed it, and the /var/lib/apt/lists from the borked
mirrors are up as the 60mb file
http://dl.dropbox.com/u/7303416/bug...sts.tar.xz .

I may try to dig into it myself, but don't expect much!

And thanks, again, Daniel, for walking me through.

-Sohum



To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact
email Follow the discussion Replies Reply to this message
Help Create a new topicReplies Make a reply
Search Make your own search