Subject: Bug#894455: aptitude: Segfault while scrolling through package list

From: Axel Beckert <[email-masked]>
Date: Fri, 30 Mar 2018 17:21:05 +0200

Package: aptitude
Version: 0.8.10-6

Hi,

aptitude (running inside GNU Screen) just segfaulted while browsing with
"cursor down" through the "Obsolete and locally installed packages"
list:

$ gdb -q aptitude-curses /var/crash/0/23865-0-0-11-1522417552-c-cactus2--usr-bin-aptitude-curses.core
Reading symbols from aptitude-curses...Reading symbols from /usr/lib/debug/.build-id/43/f28dce371f83231f358317490dc7f606b12753.debug...done.
done.

warning: core file may not match specified executable file.
[New LWP 23865]
[New LWP 26420]
[New LWP 26410]
[New LWP 26411]
[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 -u'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f2256c3a686 in ?? () from /usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0
[Current thread is 1 (Thread 0x7f2257052800 (LWP 23865))]
(gdb) bt
#0  0x00007f2256c3a686 in ?? () from /usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0
#1  0x00007f2256c3a741 in ?? () from /usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0
#2  0x00007f2256c3a7a3 in ?? () from /usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0
#3  0x00007f2256c39e23 in pkgTagSection::FindS[abi:cxx11](char const*) const () from /usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0
#4  0x00007f2256bc8028 in ?? () from /usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0
#5  0x000056275e4ea1e0 in pkg_description_widget::set_package (this=0x56275fad5c70, pkg=..., ver=...) at ../../src/pkg_view.cc:308
#6  0x000056275e4ea44a in info_area_multiplex::set_package (this=0x56275fadbb70, pkg=..., ver=...) at ../../src/pkg_view.cc:453
#7  0x000056275e4c1460 in sigc::internal::signal_emit2<void, pkgCache::PkgIterator const&, pkgCache::VerIterator const&, sigc::nil>::emit (_A_a2=..., 
    _A_a1=..., impl=0x56275fc6d070) at /usr/include/sigc++-2.0/sigc++/signal.h:1300
#8  sigc::signal2<void, pkgCache::PkgIterator const&, pkgCache::VerIterator const&, sigc::nil>::emit (this=<optimized out>, _A_a2=..., _A_a1=...)
    at /usr/include/sigc++-2.0/sigc++/signal.h:3108
#9  sigc::signal2<void, pkgCache::PkgIterator const&, pkgCache::VerIterator const&, sigc::nil>::operator() (_A_a2=..., _A_a1=..., this=<optimized out>)
    at /usr/include/sigc++-2.0/sigc++/signal.h:3124
#10 pkg_item::do_highlighted_changed (this=0x5627669e2140, highlighted=<optimized out>) at ../../src/pkg_item.cc:115
#11 0x00007f225623d2bd in sigc::internal::signal_emit1<void, bool, sigc::nil>::emit (impl=0x5627669e2230, _A_a1=@0x7ffc3ddcebc0: true)
    at /usr/include/sigc++-2.0/sigc++/signal.h:1045
#12 0x00007f2256238cf9 in sigc::signal1<void, bool, sigc::nil>::emit (this=<optimized out>, _A_a1=@0x7ffc3ddcebc0: true)
    at /usr/include/sigc++-2.0/sigc++/signal.h:2955
#13 sigc::signal1<void, bool, sigc::nil>::operator() (_A_a1=@0x7ffc3ddcebc0: true, this=<optimized out>) at /usr/include/sigc++-2.0/sigc++/signal.h:2971
#14 cwidget::widgets::tree::line_down (this=this@entry=0x56275facb190) at tree.cc:404
#15 0x00007f225623c488 in cwidget::widgets::tree::handle_key (this=this@entry=0x56275facb190, k=...) at tree.cc:796
#16 0x000056275e4b551b in menu_tree::handle_key (this=0x56275facb190, k=...) at ../../src/menu_tree.cc:430
#17 0x000056275e4d2623 in pkg_tree::handle_key (this=0x56275facb190, k=...) at ../../src/pkg_tree.cc:363
#18 0x00007f22562409c5 in cwidget::widgets::widget::dispatch_key (this=this@entry=0x56275facb190, k=...) at widget.cc:267
#19 0x00007f22562280bc in cwidget::widgets::table::handle_key (this=0x56275fc6c490, k=...) at table.cc:576
#20 0x00007f22562409c5 in cwidget::widgets::widget::dispatch_key (this=0x56275fc6c490, k=...) at widget.cc:267
#21 0x00007f225621357b in cwidget::widgets::passthrough::handle_key (this=0x56275fada820, k=...) at passthrough.cc:98
#22 0x00007f22562409c5 in cwidget::widgets::widget::dispatch_key (this=this@entry=0x56275fada820, k=...) at widget.cc:267
#23 0x00007f22562280bc in cwidget::widgets::table::handle_key (this=0x56275fadb470, k=...) at table.cc:576
#24 0x00007f22562409c5 in cwidget::widgets::widget::dispatch_key (this=0x56275fadb470, k=...) at widget.cc:267
#25 0x00007f225621357b in cwidget::widgets::passthrough::handle_key (this=0x56275fac35e0, k=...) at passthrough.cc:98
#26 0x00007f22562409c5 in cwidget::widgets::widget::dispatch_key (this=0x56275fac35e0, k=...) at widget.cc:267
#27 0x00007f22561f6449 in cwidget::widgets::menubar::handle_key (this=0x56275face7c0, k=...) at menubar.cc:641
#28 0x00007f22562409c5 in cwidget::widgets::widget::dispatch_key (this=0x56275face7c0, k=...) at widget.cc:267
#29 0x00007f22561c481f in cwidget::toplevel::input_thread::get_input_event::dispatch (this=0x7f223c000b20) at toplevel.cc:400
#30 0x00007f22561bc919 in cwidget::toplevel::mainloop (synch=synch@entry=0) at toplevel.cc:1171
#31 0x000056275e529bea in ui_main () at ../../src/ui.cc:3134
#32 0x000056275e44f1a4 in main (argc=<optimized out>, argv=<optimized out>) at ../../src/main.cc:1430
(gdb) 

-- Package-specific info:

-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (980, 'unstable-debug'), (600, 'testing'), (111, 'buildd-unstable'), (111, 'buildd-experimental'), (110, 'experimental'), (105, 'experimental-debug')
Architecture: amd64 (x86_64)

Kernel: Linux 4.15.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages aptitude depends on:
ii  aptitude-common            0.8.10-6
ii  libapt-pkg5.0              1.6~beta1
ii  libboost-filesystem1.62.0  1.62.0+dfsg-5
ii  libboost-iostreams1.62.0   1.62.0+dfsg-5
ii  libboost-system1.62.0      1.62.0+dfsg-5
ii  libc6                      2.27-3
ii  libcwidget3v5              0.5.17-7
ii  libgcc1                    1:8-20180321-1
ii  libncursesw5               6.1-1
ii  libsigc++-2.0-0v5          2.10.0-2
ii  libsqlite3-0               3.22.0-2
ii  libstdc++6                 8-20180321-1
ii  libtinfo5                  6.1-1
ii  libxapian30                1.4.5-1

Versions of packages aptitude recommends:
ii  libparse-debianchangelog-perl  1.2.0-12
ii  sensible-utils                 0.0.12

Versions of packages aptitude suggests:
ii  apt-xapian-index                0.49
ii  aptitude-doc-en [aptitude-doc]  0.8.10-6
ii  debtags                         2.1.5
ii  tasksel                         3.43

-- no debconf information