Getting 'stack level too deep' errors and segmentation faults

  1. ast

    Hi Wincent,

    I'm so eager to try Command-T out, but I can't make it work.

    Vim is compiled with Ruby support, C extension is compiled without errors (seemingly), compilation is performed with system Ruby.

    Still, :CommandT shows the list of files, but when I start typing I get this error:

    http://img580.imageshack.us/img580/9128/screenshotselection0012.png

    In different cases error happens in different methods of Prompt class (I think it depends on current directory or on directory that is given to :CommandT as an argument), but always in prompt.rb file.

    Information about environment:

    • OS: openSUSE Linux 11.4 x64
    • when I type :ruby p RUBY_VERSION in Vim, it prints "1.8.7"

    Output of some shell commands:

    .-(~/.vim-plugins/Command-T/ruby/command-t)-----------------------------------------------(ast@ast)-
    `--> vim --version
    VIM - Vi IMproved 7.3 (2010 Aug 15)
    Included patches: 1-62
    Compiled by 'http://www.opensuse.org/'
    Huge version without GUI.  Features included (+) or not (-):
    +arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent 
    +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments 
    +conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs 
    -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path 
    +find_in_path +float +folding -footer +fork() +gettext -hangul_input +iconv 
    +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent 
    +listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape 
    +mouse_dec +mouse_gpm -mouse_jsbterm +mouse_netterm -mouse_sysmouse 
    +mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype 
    +path_extra +perl +persistent_undo +postscript +printer +profile +python 
    -python3 +quickfix +reltime +rightleft +ruby +scrollbind +signs +smartindent 
    +sniff +startuptime +statusline -sun_workshop +syntax +tag_binary 
    +tag_old_static -tag_any_white +tcl +terminfo +termresponse +textobjects +title
     -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo 
    +vreplace +wildignore +wildmenu +windows +writebackup +X11 +xfontset -xim 
    +xsmp_interact +xterm_clipboard -xterm_save 
       system vimrc file: "/etc/vimrc"
         user vimrc file: "$HOME/.vimrc"
          user exrc file: "$HOME/.exrc"
      fall-back for $VIM: "/etc"
     f-b for $VIMRUNTIME: "/usr/share/vim/current"
    Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -Wall -pipe -fno-strict-aliasing -fstack-protector-all    -I/usr/include  -D_LARGEFILE64_SOURCE=1  
    Linking: gcc   -L.  -rdynamic -Wl,-export-dynamic  -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.12.3/x86_64-linux-thread-multi/CORE   -L/usr/local/lib -Wl,--as-needed -o vim    -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -lnsl   -lncurses -lacl -lattr -lgpm -ldl    -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.12.3/x86_64-linux-thread-multi/CORE  -L/usr/local/lib64 -fstack-protector  -L/usr/lib/perl5/5.12.3/x86_64-linux-thread-multi/CORE -lperl -lm -ldl -lcrypt -lpthread -L/usr/lib64/python2.7/config -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic  -L/usr/lib64 -ltcl8.5 -ldl -lieee -lm -Wl,-R -Wl,/usr/lib64 -L/usr/lib64 -lruby -lrt -ldl -lcrypt -lm   
    .-(~/.vim-plugins/Command-T/ruby/command-t)-----------------------------------------------(ast@ast)-
    `--> rvm current
    system
    .-(~/.vim-plugins/Command-T/ruby/command-t)-----------------------------------------------(ast@ast)-
    `--> ruby --version
    ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]
    .-(~/.vim-plugins/Command-T/ruby/command-t)-----------------------------------------------(ast@ast)-
    `--> which ruby
    /usr/bin/ruby
    .-(~/.vim-plugins/Command-T/ruby/command-t)-----------------------------------------------(ast@ast)-
    `--> ruby extconf.rb 
    checking for ruby.h... yes
    creating Makefile
    .-(~/.vim-plugins/Command-T/ruby/command-t)-----------------------------------------------(ast@ast)-
    `--> make
    gcc -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I/usr/lib64/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_H    -fPIC -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -g -fno-strict-aliasing  -fPIC   -std=c99 -Wall -Wextra -Wno-unused-parameter -c match.c
    gcc -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I/usr/lib64/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_H    -fPIC -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -g -fno-strict-aliasing  -fPIC   -std=c99 -Wall -Wextra -Wno-unused-parameter -c matcher.c
    gcc -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I/usr/lib64/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_H    -fPIC -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -g -fno-strict-aliasing  -fPIC   -std=c99 -Wall -Wextra -Wno-unused-parameter -c ext.c
    gcc -shared -o ext.so match.o matcher.o ext.o -L. -L/usr/lib64 -Wl,-R/usr/lib64 -L.  -rdynamic -Wl,-export-dynamic    -Wl,-R -Wl,/usr/lib64 -L/usr/lib64 -lruby  -lrt -ldl -lcrypt -lm   -lc
    

    Thanks.

  2. Greg Hurrell

    The scoring algorithm is recursive, so it is conceivable that it could potentially exceed the stack depth limit, but I've never seen it myself nor had any reports of it until now. (You'd need very deeply nested folder hierarchies with very long path lengths to get that far, I would think).

    Any idea how deeply nested the directory hierarchy is where you're trying this, and how long the paths are? (In practice, you're unlikely to hit the limit anyway, as there is a default max-depth of 10 that will stop Command-T from scanning once it drills down too deep anyway.)

  3. ast

    It doesn't seem to depend on the amount of nested levels of directories. I've just tried to test it in ruby/command-t directory, which only has one level of subdirectories and had the same result. And, btw, it also segfaults sometimes when typing, but I can't find the reliable way of reproducing it. Something must be really wrong with my environment...

    Although I've tried to compile Vim with switches like was described in one of topics and also had this problem when ran ./src/vim from source directory after compilation.

  4. ast

    I've also tried to increase maximum stack size limit as described here, bit it had no effect.

  5. Greg Hurrell

    I know a buggy version of Vim shipped with Ubuntu 11.04, although you say you're on OpenSUSE. Where'd you get your version of Vim from?

  6. ast

    It's Vim that comes with OS (rpm). And the one that I've tried to compile is from official Mercurial repo.

  7. ast

    The trick was in installing Command-T into standard directory. Previously I installed it using VAM into ~/.vim-plugins/Command-T directory. Once I installed it into ~/.vim using Vimball it started working. The drawback of this is that I'll have to update Command-T manually. But it works, and I like it more then FuzzyFinder so far. Thanks you :)

Reply

This topic is now closed.