Package: aptitude
Version: 0.8.1-1
Severity: important
Tags: patch

Dear Maintainer,

A while back, I noticed that aptitude and apt could no longer be used
together on my system: If aptitude had been used to update Packages and
Sources lists too, apt would not see the lists. (And vice versa.)

This happened because aptitude now formats port numbers in URLs with
thousands' grouping characters as defined by the locale (in this case
en_US.utf-8):

,----
| $ sudo aptitude update
| Hit http://localhost:9,999/debian sid InRelease
| Get: 1 http://localhost:9,999/debian stretch InRelease [232 kB]
| [...]
| $ sudo LANG=C aptitude update
| Get: 1 http://localhost:9999/debian sid InRelease [205 kB]
| Get: 2 http://localhost:9999/debian stretch InRelease [232 kB]
| [...]
`----

The extra comma also ended up as part of the filenames in
/var/lib/apt/lists, which explains the described behavior.

Version 0.7.5-3 does not have this problem.

Further investigation shows that commit
198c06d1d481728147f61c1482ac7e52337363db (Change filename of lock file
from tag "literal" to "filename") contains a seemingly unrelated change
where setlocale() is replaced with a call to the C++ stdlib.

Reverting that bit fixes the problem for me; I have attached a patch.

Cheers,
-Hilko

-- Package-specific info:
Terminal: eterm-color
$DISPLAY is set.
which aptitude: /usr/bin/aptitude

aptitude version information:
aptitude 0.8.1
Compiler: g++ 5.3.1 20160429
Compiled against:
  apt version 5.0.0
  NCurses version 6.0
  libsigc++ version: 2.8.0
  Gtk+ support disabled.
  Qt support disabled.

Current library versions:
  NCurses version: ncurses 6.0.20160319
  cwidget version: 0.5.17
  Apt version: 5.0.0

aptitude linkage:
        linux-vdso.so.1 (0x00007ffd8030e000)
        libapt-pkg.so.5.0 => /usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0 
(0x00007f845e6d2000)
        libncursesw.so.5 => /lib/x86_64-linux-gnu/libncursesw.so.5 
(0x00007f845e4a2000)
        libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 
(0x00007f845e277000)
        libsigc-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libsigc-2.0.so.0 
(0x00007f845e070000)
        libcwidget.so.3 => /usr/lib/x86_64-linux-gnu/libcwidget.so.3 
(0x00007f845dd73000)
        libsqlite3.so.0 => /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 
(0x00007f845da6e000)
        libboost_iostreams.so.1.58.0 => 
/usr/lib/x86_64-linux-gnu/libboost_iostreams.so.1.58.0 (0x00007f845d854000)
        libboost_filesystem.so.1.58.0 => 
/usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0 (0x00007f845d63b000)
        libboost_system.so.1.58.0 => 
/usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0 (0x00007f845d436000)
        libxapian.so.22 => /usr/lib/x86_64-linux-gnu/libxapian.so.22 
(0x00007f845d032000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
(0x00007f845ce15000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 
(0x00007f845ca94000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f845c796000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 
(0x00007f845c580000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f845c1db000)
        libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f845bfd8000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f845bdd4000)
        libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 
(0x00007f845bbbc000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f845b9a1000)
        libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 
(0x00007f845b791000)
        liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f845b56d000)
        liblz4.so.1 => /usr/lib/x86_64-linux-gnu/liblz4.so.1 
(0x00007f845b35b000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f845b152000)
        libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f845af4d000)
        /lib64/ld-linux-x86-64.so.2 (0x000055e8e522b000)
-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.4.0-1-amd64 (SMP w/6 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages aptitude depends on:
ii  aptitude-common            0.8.1-1
ii  libapt-pkg5.0              1.2.12
ii  libboost-filesystem1.58.0  1.58.0+dfsg-5+b1
ii  libboost-iostreams1.58.0   1.58.0+dfsg-5+b1
ii  libboost-system1.58.0      1.58.0+dfsg-5+b1
ii  libc6                      2.22-9
ii  libcwidget3v5              0.5.17-4+b1
ii  libgcc1                    1:6.1.1-4
ii  libncursesw5               6.0+20160319-1
ii  libsigc++-2.0-0v5          2.8.0-1
ii  libsqlite3-0               3.13.0-1
ii  libstdc++6                 6.1.1-4
ii  libtinfo5                  6.0+20160319-1
ii  libxapian22v5              1.2.23-1

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

Versions of packages aptitude suggests:
ii  apt-xapian-index                0.47+nmu2
ii  aptitude-doc-en [aptitude-doc]  0.8.1-1
pn  debtags                         <none>
pn  tasksel                         <none>

-- no debconf information
Index: aptitude/src/main.cc
===================================================================
--- aptitude.orig/src/main.cc
+++ aptitude/src/main.cc
@@ -659,16 +659,7 @@ int main(int argc, char *argv[])
   //cw::util::transcode_mbtow_err=handle_mbtow_error;
   //cw::util::transcode_wtomb_err=handle_wtomb_error;
 
-  // Use the C++ classes if possible, otherwise if ::global() is not called the
-  // internal state of std::locale is not initialized properly
-  //
-  // it can throw an exception if the locale defined in the environment is not
-  // valid
-  try {
-    std::locale::global(std::locale(""));
-  } catch (...) {
-    setlocale(LC_ALL, "");
-  }
+  setlocale(LC_ALL, "");
   bindtextdomain(PACKAGE, LOCALEDIR);
   textdomain(PACKAGE);
 

Reply via email to