When running it in gdb, I get the following backtrace:
Starting program: /usr/bin/apt-cache search apt
^C
Program received signal SIGINT, Interrupt.
0xb7fdd424 in __kernel_vsyscall ()
(gdb) bt
#0  0xb7fdd424 in __kernel_vsyscall ()
#1  0xb7c9c70f in __getdents64 (fd=16304, buf=<optimized out>, 
nbytes=<optimized out>) at ../sysdeps/unix/sysv/linux/getdents.c:156
#2  0xb7c9c977 in __readdir64 (dirp=0x806d1d8) at ../sysdeps/unix/readdir.c:66
#3  0xb7f58d5a in APT::Configuration::getLanguages(bool const&, bool const&, 
char const**) () from /usr/lib/i386-linux-gnu/libapt-pkg.so.4.12
#4  0xb7edf650 in pkgCache::VerIterator::TranslatedDescription() const () from 
/usr/lib/i386-linux-gnu/libapt-pkg.so.4.12
#5  0x08051bd1 in Search (CmdL=...) at apt-cache.cc:1273
#6  0xb7ecaf6e in CommandLine::DispatchArg(CommandLine::Dispatch*, bool) () 
from /usr/lib/i386-linux-gnu/libapt-pkg.so.4.12
#7  0x0804e833 in main (argc=3, argv=0xbfffdf84) at apt-cache.cc:1802

So it looks like the iterator used to get translated descriptions causes
this.

This gets triggered by the following configuration:
% cat /etc/apt/apt.conf.d/20notranslation
Acquire::Languages "none";


** Summary changed:

- "apt-cache search" is slow because of listing /var/lib/apt/lists 45227 times
+ "apt-cache search" is slow because of listing /var/lib/apt/lists 45227 times 
(triggered by 'Acquire::Languages "none";')

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1004947

Title:
  "apt-cache search" is slow because of listing /var/lib/apt/lists 45227
  times (triggered by 'Acquire::Languages "none";')

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1004947/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to