Sunday, July 7, 2013

Re: Vim Lua and such

Dominique Pellé <dominique.pelle@gmail.com> [13-07-07 15:48]:
> Meino Cramer wrote:
>
> > Dominique Pellé <dominique.pelle@gmail.com> [13-07-07 14:24]:
> >> Meino Cramer wrote:
> >>
> >> > Hi,
> >> >
> >> > My vim (Gentoo Linux, compiled by myself) is configured as follows:
> >> > Huge version with GTK2 GUI. Features included (+) or not (-):
> >> > +arabic +file_in_path +mouse_sgr +tag_binary
> >> > +autocmd +find_in_path -mouse_sysmouse +tag_old_static
> >> > +balloon_eval +float +mouse_urxvt -tag_any_white
> >> > +browse +folding +mouse_xterm -tcl
> >> > ++builtin_terms -footer +multi_byte +terminfo
> >> > +byte_offset +fork() +multi_lang +termresponse
> >> > +cindent +gettext -mzscheme +textobjects
> >> > +clientserver -hangul_input +netbeans_intg +title
> >> > +clipboard +iconv +path_extra +toolbar
> >> > +cmdline_compl +insert_expand -perl +user_commands
> >> > +cmdline_hist +jumplist +persistent_undo +vertsplit
> >> > +cmdline_info +keymap +postscript +virtualedit
> >> > +comments +langmap +printer +visual
> >> > +conceal +libcall +profile +visualextra
> >> > +cryptv +linebreak -python +viminfo
> >> > +cscope +lispindent -python3 +vreplace
> >> > +cursorbind +listcmds +quickfix +wildignore
> >> > +cursorshape +localmap +reltime +wildmenu
> >> > +dialog_con_gui +lua +rightleft +windows
> >> > +diff +menu -ruby +writebackup
> >> > +digraphs +mksession +scrollbind +X11
> >> > +dnd +modify_fname +signs -xfontset
> >> > -ebcdic +mouse +smartindent +xim
> >> > +emacs_tags +mouseshape -sniff +xsmp_interact
> >> > +eval +mouse_dec +startuptime +xterm_clipboard
> >> > +ex_extra +mouse_gpm +statusline -xterm_save
> >> > +extra_search -mouse_jsbterm -sun_workshop
> >> > +farsi +mouse_netterm +syntax
> >> > system vimrc file: "$VIM/vimrc"
> >> > user vimrc file: "$HOME/.vimrc"
> >> > 2nd user vimrc file: "~/.vim/vimrc"
> >> > user exrc file: "$HOME/.exrc"
> >> > system gvimrc file: "$VIM/gvimrc"
> >> > user gvimrc file: "$HOME/.gvimrc"
> >> > 2nd user gvimrc file: "~/.vim/gvimrc"
> >> > system menu file: "$VIMRUNTIME/menu.vim"
> >> > fall-back for $VIM: "/usr/local/share/vim"
> >> >
> >> > Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK
> >> > -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include
> >> > -I/usr/include/pango-1.0 -I/usr/include/atk-1.0
> >> > -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm
> >> > -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng15
> >> > -I/usr/include/pango-1.0 -I/usr/include/glib-2.0
> >> > -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2
> >> > -I/usr/local/include -march=native -O2 -pipe -msse3
> >> > -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
> >> >
> >> > Linking: gcc -L/usr/local/lib -Wl,--as-needed -o vim
> >> > -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo
> >> > -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0
> >> > -lgobject-2.0 -lglib-2.0 -lfreetype -lfontconfig -lSM -lICE -lXpm
> >> > -lXt -lX11 -lXdmcp -lSM -lICE -lm -lncurses -lelf -lnsl -lacl
> >> > -lattr -lgpm -L/usr/lib -llua
> >> >
> >> >
> >> > I loaded a *.lua file into the editor which defines a quite large
> >> > table (nothing else), because I wanted to edit that file.
> >> >
> >> > The process didn't end, I had to shoot vim with signal 9. Poor vim...
> >> > ;)
> >> >
> >> > Is a lua script automagically executed when loaded?
> >>
> >> I don't think so.
> >>
> >> > Thank you very muc for any help in advance!
> >> >
> >> > Best regards,
> >> > mccD
> >>
> >> Perhaps syntax highlighting is slow on your file,
> >> if so, recent version of Vim may help. Try
> >> to compare with ":set re=0" and ":set re=1".
> >>
> >> Or you found a infinite loop bug.
> >>
> >> You gave all the details about your vim except the most important
> >> one: which version of Vim are you using? Latest is 7.4a.1 BETA.
> >>
> >> Can you attach your lua file?
> >>
> >> Does it happen with: "vim -u NONE --noplugin"?
> >>
> >> Dominique
>
> > Hi Dominique,
> >
> > thank you for your help! :)
> >
> > ough...I thought I had copied the complete output of "vim --version"
> > to the mail...sorry
> >
> > The version of my vim is:
> >
> > VIM - Vi IMproved 7.4a BETA (2013 Jul 6, compiled Jul 7 2013 04:35:02)
> > Included patches: 1
> >
> > I did the following:
> >
> > :set re=0
> > :r <dbfile>.lua
> >
> > and
> >
> > :set re=0
> > :r <dbfile>.lua
> >
> > . Both loads the file at a reasonable, nearly identical speed.
> >
> > Problems arises, when I do a
> >
> > #> vim dvfile.lua
> >
> > This does "not" end (will say: I dont want to wait for loading
> > a file, which normally gets loaded in fractions of a second).
> >
> > Finally I did a
> >
> > vim -u NONE --noplugin dbfile.lua
> >
> > and the file geys instantly loaded. So it seems, that a plugin
> > is found guilty.
> >
> > How can I make my guesses more precisely now?
> >
> > Best regards,
> > mcc
>
> Try those:
>
> $ vim -u NONE --noplugin -c 'set re=0' -c 'syntax on' dbfile.lua
> $ vim -u NONE --noplugin -c 'set re=1' -c 'syntax on' dbfile.lua
> $ vim -c 'set re=0' dbfile.lua
> $ vim -c 'set re=1' dbfile.lua
>
> Which one work or hang?
>
> You could try to...
> * remove plugins one by one in your ~/.vim/ dir
> * comment out pieces in your ~/.vimrc
> ... until you find what triggers the bug.
>
> Does vim take 100% of the CPU when it hangs?
> When Vim hangs, you could attach with gdb to see
> what is the stack trace in Vim, which may give ideas.
>
> $ gdb
> (gdb) attach pid_of_vim
> (gdb) bt
>
> (where pid_of_vim should be the process ID of Vim which hangs)
>
> If you're not allowed (?) to share your lua file. Perhaps you can
> share a similar Lua file which reproduces the problem. Try to
> trim down as much as possible the lua file.
>
> Does the lua file has long lines? Regexp matching may be
> very slow with the old engine in some rare cases on long
> lines. You can find the length of the longest lines with:
>
> $ perl -ne 'print length, "\n"' < dbfile.lua | sort -n | tail -5
>
> Dominique
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Hi Dominique,

I tried both:

$ vim -u NONE --noplugin -c 'set re=0' -c 'syntax on' dbfile.lua
$ vim -u NONE --noplugin -c 'set re=1' -c 'syntax on' dbfile.lua

and both load the file quick and without problems.

On the other hand, both of these:

$ vim -c 'set re=0' dbfile.lua
$ vim -c 'set re=1' dbfile.lua

result in a "hang".

Yes, you are right, I am not allowed to share the dbfile. It is very
long also.

When vim hangs it eats 100% of one core of the CPU.

I did the gdb thing on a "hanging" vim and the backtrace shows this:
GNU gdb (Gentoo 7.5.1 p2) 7.5.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>.
(gdb) attach 9838
Attaching to process 9838
Reading symbols from /usr/local/bin/vim...(no debugging symbols found)...done.
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
Reading symbols from /usr/lib64/libgtk-x11-2.0.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libgtk-x11-2.0.so.0
Reading symbols from /usr/lib64/libgdk-x11-2.0.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libgdk-x11-2.0.so.0
Reading symbols from /usr/lib64/libgdk_pixbuf-2.0.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libgdk_pixbuf-2.0.so.0
Reading symbols from /usr/lib64/libpango-1.0.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libpango-1.0.so.0
Reading symbols from /usr/lib64/libgobject-2.0.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libgobject-2.0.so.0
Reading symbols from /usr/lib64/libglib-2.0.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libglib-2.0.so.0
Reading symbols from /usr/lib64/libSM.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libSM.so.6
Reading symbols from /usr/lib64/libICE.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libICE.so.6
Reading symbols from /usr/lib64/libXt.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libXt.so.6
Reading symbols from /usr/lib64/libX11.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libX11.so.6
Reading symbols from /lib64/libm.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /lib64/libncurses.so.5...(no debugging symbols found)...done.
Loaded symbols for /lib64/libncurses.so.5
Reading symbols from /lib64/libacl.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libacl.so.1
Reading symbols from /lib64/libgpm.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libgpm.so.1
Reading symbols from /usr/lib64/liblua.so.5...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/liblua.so.5
Reading symbols from /lib64/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/libdl.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /usr/lib64/libgmodule-2.0.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libgmodule-2.0.so.0
Reading symbols from /usr/lib64/libpangocairo-1.0.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libpangocairo-1.0.so.0
Reading symbols from /usr/lib64/libXfixes.so.3...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libXfixes.so.3
Reading symbols from /usr/lib64/libatk-1.0.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libatk-1.0.so.0
Reading symbols from /usr/lib64/libcairo.so.2...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libcairo.so.2
Reading symbols from /usr/lib64/libgio-2.0.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libgio-2.0.so.0
Reading symbols from /usr/lib64/libpangoft2-1.0.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libpangoft2-1.0.so.0
Reading symbols from /usr/lib64/libfontconfig.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libfontconfig.so.1
Reading symbols from /lib64/libpthread.so.0...(no debugging symbols found)...done.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Loaded symbols for /lib64/libpthread.so.0
Reading symbols from /usr/lib64/libXext.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libXext.so.6
Reading symbols from /usr/lib64/libXrender.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libXrender.so.1
Reading symbols from /usr/lib64/libXi.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libXi.so.6
Reading symbols from /usr/lib64/libXrandr.so.2...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libXrandr.so.2
Reading symbols from /usr/lib64/libXcursor.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libXcursor.so.1
Reading symbols from /usr/lib64/libXcomposite.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libXcomposite.so.1
Reading symbols from /usr/lib64/libXdamage.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libXdamage.so.1
Reading symbols from /usr/lib64/libffi.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libffi.so.6
Reading symbols from /lib64/librt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/librt.so.1
Reading symbols from /lib64/libuuid.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libuuid.so.1
Reading symbols from /usr/lib64/libxcb.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libxcb.so.1
Reading symbols from /lib64/libattr.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libattr.so.1
Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /usr/lib64/libfreetype.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libfreetype.so.6
Reading symbols from /usr/lib64/libpixman-1.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libpixman-1.so.0
Reading symbols from /usr/lib64/libEGL.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libEGL.so.1
Reading symbols from /usr/lib64/libpng15.so.15...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libpng15.so.15
Reading symbols from /lib64/libz.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libz.so.1
Reading symbols from /usr/lib64/libGL.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libGL.so.1
Reading symbols from /lib64/libresolv.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libresolv.so.2
Reading symbols from /usr/lib64/libexpat.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libexpat.so.1
Reading symbols from /usr/lib64/libXau.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libXau.so.6
Reading symbols from /usr/lib64/libXdmcp.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libXdmcp.so.6
Reading symbols from /lib64/libbz2.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libbz2.so.1
Reading symbols from /usr/lib64/libX11-xcb.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libX11-xcb.so.1
Reading symbols from /usr/lib64/libxcb-dri2.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libxcb-dri2.so.0
Reading symbols from /usr/lib64/libxcb-xfixes.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libxcb-xfixes.so.0
Reading symbols from /lib64/libudev.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libudev.so.1
Reading symbols from /usr/lib64/libdrm.so.2...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libdrm.so.2
Reading symbols from /usr/lib64/libnvidia-tls.so.325.08...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libnvidia-tls.so.325.08
Reading symbols from /usr/lib64/libnvidia-glcore.so.325.08...(no debugging symbols found)...done.
Loaded symbols for /usr/lib64/libnvidia-glcore.so.325.08
Reading symbols from /lib64/libnss_compat.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libnss_compat.so.2
Reading symbols from /lib64/libnsl.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib64/libnsl.so.1
Reading symbols from /lib64/libnss_nis.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libnss_nis.so.2
Reading symbols from /lib64/libnss_files.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib64/libnss_files.so.2
0x00007f6140ef1f20 in ?? () from /usr/lib64/liblua.so.5
(gdb) backtrace
#0 0x00007f6140ef1f20 in ?? () from /usr/lib64/liblua.so.5
#1 0x00007f6140ee7fed in ?? () from /usr/lib64/liblua.so.5
#2 0x00007f6140ef22b6 in ?? () from /usr/lib64/liblua.so.5
#3 0x00007f6140ee7fed in ?? () from /usr/lib64/liblua.so.5
#4 0x00007f6140ee72b7 in ?? () from /usr/lib64/liblua.so.5
#5 0x00007f6140ee817e in ?? () from /usr/lib64/liblua.so.5
#6 0x00007f6140ee3ea6 in lua_pcall () from /usr/lib64/liblua.so.5
#7 0x00000000005930a8 in ?? ()
#8 0x000000000046e584 in ?? ()
#9 0x0000000000445e71 in ?? ()
#10 0x00000000004469a5 in ?? ()
#11 0x000000000044a832 in ?? ()
#12 0x0000000000449292 in ?? ()
#13 0x00000000004494c4 in ?? ()
#14 0x0000000000449721 in ?? ()
#15 0x000000000044a286 in ?? ()
#16 0x000000000044a426 in ?? ()
#17 0x000000000044a950 in ?? ()
#18 0x000000000044ab99 in ?? ()
#19 0x000000000048d3b6 in ?? ()
#20 0x000000000048fb10 in ?? ()
#21 0x000000000048fd1f in ?? ()
#22 0x0000000000490b1b in ?? ()
#23 0x00000000004cdaae in ?? ()
#24 0x00000000004cdcf5 in ?? ()
#25 0x0000000000462565 in ?? ()
#26 0x000000000046e584 in ?? ()
#27 0x0000000000445e71 in ?? ()
#28 0x00000000004469a5 in ?? ()
#29 0x000000000044a832 in ?? ()
#30 0x000000000044e13b in ?? ()
#31 0x000000000046e584 in ?? ()
#32 0x000000000048323d in ?? ()
#33 0x000000000048363a in ?? ()
#34 0x00000000004150f5 in ?? ()
#35 0x00007f6140b4f4cc in __libc_start_main () from /lib64/libc.so.6
#36 0x0000000000417205 in ?? ()
#37 0x00007fff813a1e58 in ?? ()
#38 0x000000000000001c in ?? ()
#39 0x0000000000000002 in ?? ()
#40 0x00007fff813a263f in ?? ()
#41 0x00007fff813a2643 in ?? ()
#42 0x0000000000000000 in ?? ()


...the liblua-entries seems to indicate call to the lua-interpreter.

The longest line of the dbfile is 71 characters long. So I think, at
least this is no problem ;)

It seems to be a problem with one of the plugins.
Lua itsself read/interprets the dbfile without a second of delay,
though.

I am not very motivated to step through all of my plugins switch them
off/on one by one... :-/

Best regards,
mcc


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: