Bug#673130: vim-nox: Large tag files make vim (appear to) hang

Ph. Marek philipp.marek at linbit.com
Wed May 16 11:19:19 UTC 2012


Package: vim-nox
Version: 2:7.3.429-2
Severity: normal

Steps to reproduce:

*) build a large tags file (~29 MB for me)
        $ ctags -f ~/.vim/systags -R /usr/include
        (I need "-I LZMA_API+=int", too)

*) start vim
        $ vim -u NONE -U NONE -N

*) use tags file
        :set tags=~/.vim/systags

*) ask about some small string
        :echo taglist("a")

Result: no result in acceptable time; for longer strings I get an answer in
less than a second.


Using strace I observed this behaviour:

File gets opened and read
  12:37:05.682218 open(".../.vim/systags", O_RDONLY) = 6
  ...
  12:37:05.682322 read(6, "!_TAG_FILE_..."..., 4096) = 4096
vim looks at other filehandles
  12:37:05.682543 select(8, [0 5 7], NULL, [0 5], {0, 0}) = 0 (Timeout)
  12:37:05.682584 select(8, [0 5 7], NULL, [0 5], {0, 0}) = 0 (Timeout)
  ...
for a _long_ time ...
  12:37:05.683973 select(8, [0 5 7], NULL, [0 5], {0, 0}) = 0 (Timeout)
  12:37:05.684036 read(6, "ABOUT_H\t..."..., 4096) = 4096
  12:37:05.684393 select(8, [0 5 7], NULL, [0 5], {0, 0}) = 0 (Timeout)
  ...
The select() calls get more and more, the read()s fewer and fewer ....
  12:38:00.217312 select(8, [0 5 7], NULL, [0 5], {0, 0}) = 0 (Timeout)
  12:38:00.217392 read(6, "LASS
  12:38:00.217818 select(8, [0 5 7], NULL, [0 5], {0, 0}) = 0 (Timeout)
  ...
until I get impatient and press CTRL-C.
  12:38:00.463262 select(8, [0 5 7], NULL, [0 5], {0, 0}) = 1 (in [0], left {0,
0})
  12:38:00.463648 read(0, "\3", 4087) = 1
  12:38:00.463726 close(6)          = 0


I don't know exactly how vim reads tag files, but it looks as if it should do
that more actively - ie. vim shouldn't look for other events so often.

Of course, preparing such a big result list takes a bit of time (to allocate
memory etc.) ... but see here:

  $ strace -f -tt -e open,close -o /tmp/63g vim -u NONE -U NONE -N \
        -c ':set tags=~/.vim/systags' -c ':echo taglist("doesntexist")' -c :q!
gives
  13:11:27.288715 open("/home/marek/.vim/systags", O_RDONLY) = 8
  13:11:28.079105 close(8)
ie. ~0.8 sec to read the file, while the same with 'taglist("a")' interrupted
with Ctrl-C looks like this:
  13:03:34.276341 open("/home/marek/.vim/systags", O_RDONLY) = 8
  13:17:46.778306 close(8)          = 0
ie. more than 14min without visible results.


During that time the memory allocation is low:
  $ top -b | grep vim
  16143 marek     20   0  240m  22m 7608 R  50,9  0,6   5:25.91 vim
ie. 240M virtual, 22M resident memory use - that's nearly nothing (an empty vim
starts for me with 228M and 11M, resp.).

So it's not simply that a big result is still being prepared.



-- Package-specific info:

--- real paths of main Vim binaries ---
/usr/bin/vi is /usr/bin/vim.gnome
/usr/bin/vim is /usr/bin/vim.gnome
/usr/bin/gvim is /usr/bin/vim.gnome

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_AT.UTF-8, LC_CTYPE=de_AT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages vim-nox depends on:
ii  libacl1       2.2.51-5
ii  libc6         2.13-32
ii  libgpm2       1.20.4-4
ii  liblua5.1-0   5.1.5-1
ii  libperl5.14   5.14.2-9
ii  libpython2.7  2.7.3~rc2-2.1
ii  libruby1.8    1.8.7.352-2
ii  libselinux1   2.1.9-2
ii  libtinfo5     5.9-7
ii  tcl8.5        8.5.11-1
ii  vim-common    2:7.3.429-2
ii  vim-runtime   2:7.3.429-2

vim-nox recommends no packages.

Versions of packages vim-nox suggests:
pn  cscope   15.7a-3.6
pn  vim-doc  <none>

-- no debconf information





More information about the pkg-vim-maintainers mailing list