[Aptitude-devel] Bug#859907: aptitude: crashes with SIGABRT on changelog download if $LANG contains an invalid value

Axel Beckert abe at debian.org
Sun Apr 9 04:13:27 UTC 2017


Package: aptitude
Version: 0.8.6-1
Severity: normal

Hi,

I just ran into a corner case which causes a crash of aptitude:

→ env LANG=foobar aptitude changelog aptitude
terminate called after throwing an instance of 'std::runtime_error'
  what():  locale::facet::_S_create_c_locale name not valid
[1]    10697 abort (core dumped)  env LANG=foobar aptitude changelog aptitude

The crash can be triggered with both, trying to download a changelog
from within the TUI (by pressing "C") or from the commandline as shown
above.

Backtrace:

#0  __GI_raise (sig=sig at entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
#1  0x00007fbff991a40a in __GI_abort () at abort.c:89
#2  0x00007fbffa2300ad in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007fbffa22e066 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007fbffa22e0b1 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007fbffa22e2c9 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007fbffa256d0f in std::__throw_runtime_error(char const*) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x00007fbffa250024 in std::locale::facet::_S_create_c_locale(__locale_struct*&, char const*, __locale_struct*) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#8  0x00007fbffa242159 in std::locale::_Impl::_Impl(char const*, unsigned long) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#9  0x00007fbffa2433cc in std::locale::locale(char const*) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#10 0x00007fbffad69123 in boost::filesystem::path::codecvt() () from /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.62.0
#11 0x00007fbffad69c05 in boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*) () from /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.62.0
#12 0x000056082c80cc1e in boost::filesystem::unique_path (p=...) at /usr/include/boost/filesystem/operations.hpp:723
#13 aptitude::util::create_temporary_changelog_dir[abi:cxx11]() () at ../../../../src/generic/util/util.cc:511
#14 0x000056082c71999e in aptitude::(anonymous namespace)::download_thread::start_download_job (uri="gzip:///usr/share/doc/aptitude/changelog.Debian.gz", short_description="Changelog of aptitude", callbacks=std::shared_ptr (count 3, weak 1) 0x56082d24e4e8, post_thunk=0x56082c662780 <aptitude::cmdline::post_thunk(sigc::slot<void, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil> const&)>) at ../../../../src/generic/apt/download_queue.cc:957
#15 0x000056082c71a5bd in aptitude::queue_download (uri="gzip:///usr/share/doc/aptitude/changelog.Debian.gz", short_description="Changelog of aptitude", callbacks=std::shared_ptr (count 3, weak 1) 0x56082d24e4e8, post_thunk=<optimized out>) at ../../../../src/generic/apt/download_queue.cc:1190
#16 0x000056082c7365d2 in aptitude::apt::(anonymous namespace)::changelog_download::failure (this=0x56082d24e4d0, msg=...) at ../../../../src/generic/apt/pkg_changelog.cc:318
#17 0x000056082c662576 in sigc::slot0<void>::operator() (this=0x7ffdfbaeb080) at /usr/include/sigc++-2.0/sigc++/functors/slot.h:513
#18 aptitude::cmdline::(anonymous namespace)::event_loop::run (this=0x56082cb12c40 <aptitude::cmdline::(anonymous namespace)::global_event_loop>) at ../../../src/cmdline/cmdline_main_loop.cc:88
#19 aptitude::cmdline::main_loop () at ../../../src/cmdline/cmdline_main_loop.cc:109
#20 0x000056082c64b424 in (anonymous namespace)::get_changelog (info=std::shared_ptr (count 1, weak 0) 0x56082d24e3d0, term_metrics=std::shared_ptr (count 3, weak 0) 0x56082cdd4370) at ../../../src/cmdline/cmdline_changelog.cc:204
#21 0x000056082c64bd4b in (anonymous namespace)::get_changelog (term_metrics=std::shared_ptr (count 3, weak 0) 0x56082cdd4370, ver=...) at ../../../src/cmdline/cmdline_changelog.cc:228
#22 do_cmdline_changelog (packages=std::vector of length 1, capacity 1 = {...}, term_metrics=std::shared_ptr (count 3, weak 0) 0x56082cdd4370) at ../../../src/cmdline/cmdline_changelog.cc:340
#23 0x000056082c64ce0b in cmdline_changelog (argc=<optimized out>, argv=<optimized out>) at ../../../src/cmdline/cmdline_changelog.cc:421
#24 0x000056082c560401 in main (argc=3, argv=<optimized out>) at ../../src/main.cc:1288

I noticed this because I switched from locales to
open-infrastructure-locales-c.utf-8 (on a different machine than the one
I'm reporting from) but didn't change the value of $LANG in a already
running shell.

In the end I found out that open-infrastructure-locales-c.utf-8 is not
necessary to reproduce this, just an invalid (or no more valid) setting
in $LANG.

-- Package-specific info:
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: not available
URL: <http://lists.alioth.debian.org/pipermail/aptitude-devel/attachments/20170409/994ca2d4/attachment.ksh>
-------------- next part --------------

-- System Information:
Debian Release: 9.0
  APT prefers unstable
  APT policy: (990, 'unstable'), (600, 'testing'), (500, 'unstable-debug'), (500, 'buildd-unstable'), (110, 'experimental'), (1, 'experimental-debug'), (1, 'buildd-experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages aptitude depends on:
ii  aptitude-common            0.8.6-1
ii  libapt-pkg5.0              1.4
ii  libboost-filesystem1.62.0  1.62.0+dfsg-4
ii  libboost-iostreams1.62.0   1.62.0+dfsg-4
ii  libboost-system1.62.0      1.62.0+dfsg-4
ii  libc6                      2.24-9
ii  libcwidget3v5              0.5.17-4+b1
ii  libgcc1                    1:6.3.0-12
ii  libncursesw5               6.0+20161126-1
ii  libsigc++-2.0-0v5          2.10.0-1
ii  libsqlite3-0               3.16.2-3
ii  libstdc++6                 6.3.0-12
ii  libtinfo5                  6.0+20161126-1
ii  libxapian30                1.4.3-2

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

Versions of packages aptitude suggests:
ii  apt-xapian-index                0.49
ii  aptitude-doc-en [aptitude-doc]  0.8.6-1
ii  debtags                         2.1.2
pn  tasksel                         <none>

-- no debconf information


More information about the Aptitude-devel mailing list