[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#355047: apt tools segfault



Followup-For: Bug #355047
Package: apt
Version: 0.6.44.2

*** Please type your report below this line ***
apt-get and apt-cache segfault at the same program location. In the case
of apt-get, update finishes with a segfault and upgrade segfaults while
reading the package list. In the apt-cache case, just doing a search
triggers the segfault.

I have recompiled the package without optimisation and without
stripping and run it through gdb and strace.


-- Debugging session follows:
$ gdb apt-cache
GNU gdb 6.4.90-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...Using host libthread_db
library "/lib/tls/i686/cmov/libthread_db.so.1".

(gdb) run search apt
Starting program: /usr/bin/apt-cache search apt

Program received signal SIGSEGV, Segmentation fault.
0xa7c60ca3 in strlen () from /lib/tls/i686/cmov/libc.so.6
(gdb) bt
#0  0xa7c60ca3 in strlen () from /lib/tls/i686/cmov/libc.so.6
#1  0xa7deb5c6 in std::string::compare () from /usr/lib/libstdc++.so.6
#2 0xa7e9ea7a in std::operator!=<char, std::char_traits<char>, std::allocator<char> > (__lhs=@0xafb5aa1c, __rhs=0x0) at /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/bits/basic_string.h:2200 #3 0xa7f037d5 in debPackagesIndex::FindInCache (this=0x805b270, Cache=@0xafb5aa94) at deb/debindexfile.cc:308 #4 0xa7ecbb30 in CheckValidity (CacheFile=@0xafb5acd8, Start={_M_current = 0x805c528}, End={_M_current = 0x805c55c}, OutMap=0xafb5afd8)
   at pkgcachegen.cc:580
#5 0xa7ece980 in pkgMakeStatusCache (List=@0x805baf8, Progress=@0xafb5af78, OutMap=0xafb5afd8, AllowMem=true) at pkgcachegen.cc:715
#6  0x0804d307 in main (argc=3, argv=0xafb5b094) at apt-cache.cc:1791
(gdb) frame 3
#3 0xa7f037d5 in debPackagesIndex::FindInCache (this=0x805b270, Cache=@0xafb5aa94) at deb/debindexfile.cc:308
308           if (FileName != File.FileName())
(gdb) print FileName
$1 = {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x805c884 "/var/lib/apt/lists/ftp.nl.debian.org_debian_dists_unstable_main_binary-i386_Packages"}}
(gdb) print File
$2 = {Owner = 0xafb5aa94, File = 0xa7f44220}
(gdb) print File.Owner
$3 = (class pkgCache *) 0xafb5aa94
(gdb) print *File.Owner
$4 = {_vptr.pkgCache = 0x805a468, CacheFile = {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0xa7e395bc ""}}, Map = @0x805c6c8, HeaderP = 0xa7f42000, PkgP = 0xa7f42000, VerFileP = 0xa7f42000, PkgFileP = 0xa7f42000, VerP = 0xa7f42000, ProvideP = 0xa7f42000, DepP = 0xa7f42000, StringItemP = 0xa7f42000, StrP = 0xa7f42000 "\230\004", VS = 0xa7f29ca4}
(gdb) print *File.File
$5 = {FileName = 0, Archive = 0, Component = 0, Version = 0, Origin = 0, Label = 0, Architecture = 0, Site = 0, IndexType = 0, Size = 0,
 Flags = 0, NextFile = 0, ID = 0, mtime = 0}
(gdb) up
#4 0xa7ecbb30 in CheckValidity (CacheFile=@0xafb5acd8, Start={_M_current = 0x805c528}, End={_M_current = 0x805c55c}, OutMap=0xafb5afd8)
   at pkgcachegen.cc:580
580           pkgCache::PkgFileIterator File = (*Start)->FindInCache(Cache);
(gdb) frame 3
#3 0xa7f037d5 in debPackagesIndex::FindInCache (this=0x805b270, Cache=@0xafb5aa94) at deb/debindexfile.cc:308
308           if (FileName != File.FileName())
(gdb) print *this
$6 = {<pkgIndexFile> = {_vptr.pkgIndexFile = 0xa7f27048, Trusted = true}, URI = {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x805bb44 "http://ftp.nl.debian.org/debian/"}}, Dist = {static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>},
     _M_p = 0x805be5c "unstable"}}, Section = {static npos = 4294967295,
_M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x805babc "main"}}}
(gdb)


-- strace output
$ strace apt-cache search apt
execve("/usr/bin/apt-cache", ["apt-cache", "search", "apt"], [/* 31 vars */]) = 0
uname({sys="Linux", node="bscig02", ...}) = 0
brk(0)                                  = 0x805b000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xa7fab000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=108031, ...}) = 0
mmap2(NULL, 108031, PROT_READ, MAP_PRIVATE, 3, 0) = 0xa7f90000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/libapt-pkg-libc6.3-6.so.3.11", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340W\4"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=4808017, ...}) = 0
mmap2(NULL, 965892, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xa7ea4000 mmap2(0xa7f8c000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xe7) = 0xa7f8c000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/libstdc++.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340\307"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=892628, ...}) = 0
mmap2(NULL, 919172, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xa7dc3000 mmap2(0xa7e99000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xd5) = 0xa7e99000 mmap2(0xa7e9e000, 22148, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xa7e9e000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/cmov/libm.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`3\0\000"..., 512) = 512 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xa7dc2000
fstat64(3, {st_mode=S_IFREG|0644, st_size=149264, ...}) = 0
mmap2(NULL, 151712, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xa7d9c000 mmap2(0xa7dc0000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x23) = 0xa7dc0000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libgcc_s.so.1", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000\30\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=40328, ...}) = 0
mmap2(NULL, 43524, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xa7d91000 mmap2(0xa7d9b000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9) = 0xa7d9b000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260O\1"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1266832, ...}) = 0
mmap2(NULL, 1276892, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xa7c59000 mmap2(0xa7d87000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x12d) = 0xa7d87000 mmap2(0xa7d8f000, 7132, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xa7d8f000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xa7c58000
mprotect(0xa7d87000, 20480, PROT_READ)  = 0
mprotect(0xa7e99000, 12288, PROT_READ)  = 0
set_thread_area({entry_number:-1 -> 6, base_addr:0xa7c588e0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
munmap(0xa7f90000, 108031)              = 0
brk(0)                                  = 0x805b000
brk(0x807c000)                          = 0x807c000
stat64("/var/lib/apt/.", {st_mode=S_IFDIR|0755, st_size=40, ...}) = 0
stat64("/etc/apt/apt.conf.d/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 open("/etc/apt/apt.conf.d/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
getdents64(3, /* 6 entries */, 4096)    = 192
stat64("/etc/apt/apt.conf.d/10apt-listbugs", {st_mode=S_IFREG|0644, st_size=381, ...}) = 0 stat64("/etc/apt/apt.conf.d/20listchanges", {st_mode=S_IFREG|0644, st_size=141, ...}) = 0 stat64("/etc/apt/apt.conf.d/70debconf", {st_mode=S_IFREG|0644, st_size=182, ...}) = 0 stat64("/etc/apt/apt.conf.d/90debsums", {st_mode=S_IFREG|0644, st_size=127, ...}) = 0
getdents64(3, /* 0 entries */, 4096)    = 0
close(3)                                = 0
open("/etc/apt/apt.conf.d/10apt-listbugs", O_RDONLY|O_LARGEFILE) = 3
read(3, "// Check all packages whether th"..., 8191) = 381
read(3, "", 8191)                       = 0
close(3)                                = 0
open("/etc/apt/apt.conf.d/20listchanges", O_RDONLY|O_LARGEFILE) = 3
read(3, "DPkg::Pre-Install-Pkgs { \"/usr/b"..., 8191) = 141
read(3, "", 8191)                       = 0
close(3)                                = 0
open("/etc/apt/apt.conf.d/70debconf", O_RDONLY|O_LARGEFILE) = 3
read(3, "// Pre-configure all packages wi"..., 8191) = 182
read(3, "", 8191)                       = 0
close(3)                                = 0
open("/etc/apt/apt.conf.d/90debsums", O_RDONLY|O_LARGEFILE) = 3
read(3, "DPkg::Post-Invoke { \"if [ -x /us"..., 8191) = 127
read(3, "", 8191)                       = 0
close(3)                                = 0
stat64("/etc/apt/apt.conf", 0xaf8c0c9c) = -1 ENOENT (No such file or directory) stat64("/var/lib/dpkg/status", {st_mode=S_IFREG|0644, st_size=2020344, ...}) = 0
stat64("/usr/bin/dpkg", {st_mode=S_IFREG|0755, st_size=315924, ...}) = 0
stat64("/etc/debian_version", {st_mode=S_IFREG|0644, st_size=17, ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 stat64("/etc/apt/sources.list", {st_mode=S_IFREG|0644, st_size=1295, ...}) = 0
open("/etc/apt/sources.list", O_RDONLY|O_LARGEFILE) = 3
read(3, "# See sources.list(5) for more i"..., 8191) = 1295
read(3, "", 8191)                       = 0
close(3)                                = 0
stat64("/etc/apt/sources.list.d/", {st_mode=S_IFDIR|0755, st_size=1, ...}) = 0 open("/etc/apt/sources.list.d/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=1, ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
getdents64(3, /* 2 entries */, 4096)    = 48
getdents64(3, /* 0 entries */, 4096)    = 0
close(3)                                = 0
stat64("/var/lib/apt/lists/ftp.nl.debian.org_debian_dists_unstable_Release.gpg", {st_mode=S_IFREG|0644, st_size=189, ...}) = 0 stat64("/var/lib/apt/lists/ftp.nl.debian.org_debian_dists_unstable_Release.gpg", {st_mode=S_IFREG|0644, st_size=189, ...}) = 0 stat64("/var/lib/apt/lists/ftp.nl.debian.org_debian_dists_unstable_Release.gpg", {st_mode=S_IFREG|0644, st_size=189, ...}) = 0 stat64("/var/lib/apt/lists/ftp.nl.debian.org_debian_dists_unstable_Release.gpg", {st_mode=S_IFREG|0644, st_size=189, ...}) = 0 stat64("/var/lib/apt/lists/ftp.nl.debian.org_debian_dists_unstable_Release.gpg", {st_mode=S_IFREG|0644, st_size=189, ...}) = 0 stat64("/var/lib/apt/lists/ftp.nl.debian.org_debian_dists_unstable_Release.gpg", {st_mode=S_IFREG|0644, st_size=189, ...}) = 0 stat64("/var/lib/apt/lists/http.us.debian.org_debian_dists_unstable_Release.gpg", {st_mode=S_IFREG|0644, st_size=189, ...}) = 0 stat64("/var/lib/apt/lists/http.us.debian.org_debian_dists_unstable_Release.gpg", {st_mode=S_IFREG|0644, st_size=189, ...}) = 0 stat64("/var/lib/apt/lists/http.us.debian.org_debian_dists_unstable_Release.gpg", {st_mode=S_IFREG|0644, st_size=189, ...}) = 0 stat64("/var/lib/apt/lists/non-us.debian.org_debian-non-US_dists_stable_non-US_Release.gpg", {st_mode=S_IFREG|0644, st_size=197, ...}) = 0 stat64("/var/lib/apt/lists/non-us.debian.org_debian-non-US_dists_stable_non-US_Release.gpg", {st_mode=S_IFREG|0644, st_size=197, ...}) = 0 stat64("/var/lib/apt/lists/non-us.debian.org_debian-non-US_dists_stable_non-US_Release.gpg", {st_mode=S_IFREG|0644, st_size=197, ...}) = 0
access("/var/cache/apt/", W_OK)         = -1 EACCES (Permission denied)
stat64("/var/cache/apt/pkgcache.bin", {st_mode=S_IFREG|0644, st_size=8555, ...}) = 0
open("/var/cache/apt/pkgcache.bin", O_RDONLY) = 3
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=8555, ...}) = 0
mmap2(NULL, 8555, PROT_READ, MAP_SHARED, 3, 0) = 0xa7fa8000
stat64("/var/lib/apt/lists/ftp.nl.debian.org_debian_dists_unstable_main_binary-i386_Packages", {st_mode=S_IFREG|0644, st_size=19090799, ...}) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Process 24196 detached




-- Package-specific info:

-- apt-config dump --

APT "";
APT::Architecture "i386";
APT::Build-Essential "";
APT::Build-Essential:: "build-essential";
Dir "/";
Dir::State "var/lib/apt/";
Dir::State::lists "lists/";
Dir::State::cdroms "cdroms.list";
Dir::State::userstatus "status.user";
Dir::State::status "/var/lib/dpkg/status";
Dir::Cache "var/cache/apt/";
Dir::Cache::archives "archives/";
Dir::Cache::srcpkgcache "srcpkgcache.bin";
Dir::Cache::pkgcache "pkgcache.bin";
Dir::Etc "etc/apt/";
Dir::Etc::sourcelist "sources.list";
Dir::Etc::sourceparts "sources.list.d";
Dir::Etc::vendorlist "vendors.list";
Dir::Etc::vendorparts "vendors.list.d";
Dir::Etc::main "apt.conf";
Dir::Etc::parts "apt.conf.d";
Dir::Etc::preferences "preferences";
Dir::Bin "";
Dir::Bin::methods "/usr/lib/apt/methods";
Dir::Bin::dpkg "/usr/bin/dpkg";
DPkg "";
DPkg::Pre-Install-Pkgs "";
DPkg::Pre-Install-Pkgs:: "if dpkg -s apt-listbugs | grep -q '^Status: .* ok installed'; then /usr/sbin/apt-listbugs apt || ( test $? -ne 10 || exit 10; echo 'Warning: apt-listbugs exited abnormally, hit enter key to continue.' 1>&2 ; read a < /dev/tty ); fi";
DPkg::Pre-Install-Pkgs:: "/usr/bin/apt-listchanges --apt || test $? -ne 10";
DPkg::Pre-Install-Pkgs:: "/usr/sbin/dpkg-preconfigure --apt || true";
DPkg::Tools "";
DPkg::Tools::Options "";
DPkg::Tools::Options::/usr/bin/apt-listchanges "";
DPkg::Tools::Options::/usr/bin/apt-listchanges::Version "2";
DPkg::Post-Invoke "";
DPkg::Post-Invoke:: "if [ -x /usr/bin/debsums ]; then /usr/bin/debsums --generate=nocheck -sp /var/cache/apt/archives; fi";

-- /etc/apt/preferences --


-- /etc/apt/sources.list --

# See sources.list(5) for more information, especialy
# Remember that you can only use http, ftp or file URIs
# CDROMs are managed through the apt-cdrom tool.
#deb http://http.us.debian.org/debian/ unstable main contrib non-free
#deb http://non-us.debian.org/debian-non-US/ stable/non-US main contrib non-free
# deb http://security.debian.org/ unstable/updates main contrib non-free
deb http://ftp.nl.debian.org/debian/ unstable main contrib non-free
deb-src http://ftp.nl.debian.org/debian/ unstable main contrib non-free

#deb http://ftp.es.debian.org/debian/ unstable main contrib non-free
#deb-src http://ftp.es.debian.org/debian/ unstable main contrib non-free

# Uncomment if you want the apt-get source function to work
deb-src http://http.us.debian.org/debian/ unstable main contrib non-free
deb-src http://non-us.debian.org/debian-non-US/ stable/non-US main contrib non-free

# deb http://kanotix.com/files/debian/ ./
# deb-src http://kanotix.com/files/debian/ ./


#deb http://wine.sourceforge.net/apt/ binary/
#deb-src http://wine.sourceforge.net/apt/ source/


#deb http://www.backports.org/~mkoch/unstable/ ./
#deb-src http://www.backports.org/~mkoch/unstable/ ./

#deb ftp://ftp.nerim.net/debian-marillat/ sid main
#deb-src ftp://ftp.nerim.net/debian-marillat/ sid main



-- System Information:
Debian Release: testing/unstable
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-2-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages apt depends on:
ii  libc6                         2.3.6-15   GNU C Library: Shared libraries
ii  libgcc1                       1:4.1.1-8  GCC support library
ii  libstdc++6                    4.1.1-8    The GNU Standard C++ Library v3

Versions of packages apt recommends:
pn  debian-archive-keyring        <none>     (no description available)

-- no debconf information




Reply to: