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

Bug#544066: aptitude: segfault on update "u" command



retitle 544066 apt crashes if index fetching fails
thanks

Hello,

On penktadienis 28 Rugpjūtis 2009 19:58:24 Sven Joachim wrote:
> > When I tried "aptitude -u" I received a segfault.
> >
> > Running it under gdb and getting a backtrace showed:
> >
> > (gdb) bt
> > #0  0x4cdfe19b in pkgAcqIndex::Failed(std::string,
> > pkgAcquire::MethodConfig*) () from /usr/lib/libapt-pkg-libc6.9-6.so.4.8
> > #1  0x4cddfceb in pkgAcquire::Worker::RunMessages() ()
> >    from /usr/lib/libapt-pkg-libc6.9-6.so.4.8
> > #2  0x4cde0d60 in pkgAcquire::Worker::InFdReady() ()
> >    from /usr/lib/libapt-pkg-libc6.9-6.so.4.8
> > #3  0x4cdd8c3a in pkgAcquire::RunFds(fd_set*, fd_set*) ()
> >    from /usr/lib/libapt-pkg-libc6.9-6.so.4.8
> > #4  0x4cddaa6f in pkgAcquire::Run(int) ()
> >    from /usr/lib/libapt-pkg-libc6.9-6.so.4.8
>
> It is libapt that is segfaulting, and reportedly this happens also with
> apt-get.

apt crashes when it fails to fetch a Packages file for some reason,
e.g. it does not exist (tested with both http and ftp). Below you will
find the backtrace of crash reproduced with apt 0.7.23 with debug
symbols:

# echo "deb http://ftp.de.debian.org/ doesnt exist" > /etc/apt/sources.list.d/doestexist.list

# gdb --args apt-get update
GNU gdb (GDB) 6.8.50.20090628-cvs-debian
Copyright (C) 2009 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/>...                                                                    

warning: not using untrusted file "/home/modax/.gdbinit"
(gdb) r
Starting program: /mnt/sda2/usr/bin/apt-get update
[ snip ]
93% [Waiting for headers] [Connecting to www.debian-multimedia.org (91.121.86.213)] [Waiting for 
headers]
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7633803 in std::string::size() const () from /usr/lib/libstdc++.so.6
(gdb) bt
#0  0x00007ffff7633803 in std::string::size() const () from /usr/lib/libstdc++.so.6
#1  0x00007ffff7b6e5ba in pkgAcqIndex::Failed (this=0x654ab0, Message=..., Cnf=0x635830) at acquire-
item.cc:595
#2  0x00007ffff7b4c374 in pkgAcquire::Worker::RunMessages (this=0x640130) at acquire-worker.cc:346
#3  0x00007ffff7b4c6c5 in pkgAcquire::Worker::InFdReady (this=0x640130) at acquire-worker.cc:545
#4  0x00007ffff7b458b4 in pkgAcquire::RunFds (this=0x7fffffffd810, RSet=0x7fffffffd680, 
WSet=0x7fffffffd600) at acquire.cc:307
#5  0x00007ffff7b46b22 in pkgAcquire::Run (this=0x7fffffffd810, PulseIntervall=500000) at 
acquire.cc:356
#6  0x00007ffff7b3c7e2 in ListUpdate (Stat=..., List=..., PulseInterval=0) at algorithms.cc:1370
#7  0x000000000040c8d4 in DoUpdate (CmdL=...) at apt-get.cc:1400
#8  0x00007ffff7b14995 in CommandLine::DispatchArg (this=0x7fffffffe680, Map=0x7fffffffe570, 
NoMatch=true) at contrib/cmndline.cc:337
#9  0x000000000040bb58 in main (argc=2, argv=0x7fffffffe798) at apt-get.cc:2866
(gdb)

-- 
Modestas Vainius <modestas@vainius.eu>

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: