Loading ...
Sorry, an error occurred while loading the content.

Bug in 7.0.178? redir => var makes vim crash (sometimes)

Expand Messages
  • Thomas
    Hi, The following code makes vim crash sometimes. fun! MakeVimCrash() redir = lets silent let redir END endf call MakeVimCrash() It doesn t crash always.
    Message 1 of 3 , Jan 2, 2007
    • 0 Attachment
      Hi,

      The following code makes vim crash sometimes.

      fun! MakeVimCrash()
      redir => lets
      silent let
      redir END
      endf
      call MakeVimCrash()

      It doesn't crash always. Sometimes I have to call the function twice.

      I now ran a few more tests. It appears that vim is more likely to crash
      when loading more plugins. When I remove plugins, I can call the
      function more often. I'm not able to pin it down this problem to one
      specific plugin though.

      BTW, this is part of the following function:

      fun! ResetOption(name)
      if empty(a:name)
      redir => lets
      silent let
      redir END
      let options = split(lets, "\n")
      call filter(options, 'v:val =~ ''^[^_]\+_default\s''')
      call map(options, 'matchstr(v:val, ''^[^_]\+\ze_default\s'')')
      call filter(options, 'exists("&".v:val)')
      else
      let options = split(a:name, '\W\+')
      endif
      for name in options
      let name0 = 'g:'. name .'_default'
      if exists(name0)
      exec 'let &'. name .' = '. name0
      endif
      endfor
      endf
      command! -nargs=* ResetOption :call ResetOption(<q-args>)

      Use it like this (eg to deal with misbehaving plugins changing global
      options):

      let g:tabstop_default = 4
      let &tabstop = g:tabstop_default

      let &tabstop = 8
      ResetOption

      Unfortunately :set doesn't provide a way to (re)set user-defined default
      values, it seems.

      Regards,
      Thomas.
    • Thomas
      ... I use: VIM - Vi IMproved 7.0 (2006 May 7, compiled Dec 16 2006 08:23:08) MS-Windows 32 bit GUI version with OLE support Included patches: 1-178 Compiled
      Message 2 of 3 , Jan 2, 2007
      • 0 Attachment
        > It doesn't crash always. Sometimes I have to call the function twice.

        I use:

        VIM - Vi IMproved 7.0 (2006 May 7, compiled Dec 16 2006 08:23:08)
        MS-Windows 32 bit GUI version with OLE support
        Included patches: 1-178
        Compiled @SAMSON
        Big version with GUI. Features included (+) or not (-):
        +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset
        +cindent +clientserver +clipboard
        +cmdline_compl +cmdline_hist +cmdline_info +comments +cryptv +cscope
        +cursorshape +dialog_con_gui +diff
        +digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi
        +file_in_path +find_in_path +folding
        -footer +gettext/dyn -hangul_input +iconv/dyn +insert_expand +jumplist
        +keymap +langmap +libcall +linebreak
        +lispindent +listcmds +localmap +menu +mksession +modify_fname +mouse
        +mouseshape +multi_byte_ime/dyn
        +multi_lang -mzscheme +netbeans_intg +ole -osfiletype +path_extra
        +perl/dyn -postscript +printer -profile
        +python/dyn +quickfix +reltime +rightleft +ruby/dyn +scrollbind +signs
        +smartindent -sniff +statusline
        -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl
        -tgetent -termresponse +textobjects
        +title +toolbar +user_commands +vertsplit +virtualedit +visual
        +visualextra +viminfo +vreplace +wildignore
        +wildmenu +windows +writebackup -xfontset -xim -xterm_save -xpm_w32
        system vimrc file: "$VIM\vimrc"
        user vimrc file: "$HOME\_vimrc"
        2nd user vimrc file: "$VIM\_vimrc"
        user exrc file: "$HOME\_exrc"
        2nd user exrc file: "$VIM\_exrc"
        system gvimrc file: "$VIM\gvimrc"
        user gvimrc file: "$HOME\_gvimrc"
        2nd user gvimrc file: "$VIM\_gvimrc"
        system menu file: "$VIMRUNTIME\menu.vim"
        Compilation: gcc -O3 -fomit-frame-pointer -freg-struct-return
        -fno-strength-reduce -DWIN32 -DHAVE_PATHDEF -DFEAT_ -DWINVER=0x0400
        -D_WIN32_WINNT=0x0400 -DFEAT_PERL -DDYNAMIC_PERL
        -DDYNAMIC_PERL_DLL="perl58.dll" -DFEAT_PYTHON -DDYNAMIC_PYTHON
        -DDYNAMIC_PYTHON_DLL="python24.dll" -DFEAT_RUBY -DDYNAMIC_RUBY
        -DDYNAMIC_RUBY_DLL="msvcrt-ruby18.dll" -DDYNAMIC_RUBY_VER=18
        -DDYNAMIC_GETTEXT -DDYNAMIC_ICONV -DFEAT_MBYTE -DFEAT_MBYTE_IME
        -DDYNAMIC_IME -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG -DFEAT_GUI_W32
        -DFEAT_CLIPBOARD -DFEAT_OLE -march=pentium-m -Iproto -Ic:/Perl/lib/CORE
        -Ic:/Python24/include -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -s -mno-cygwin
        Linking: gcc -s -o gvim.exe -luuid -lole32 -lwsock32 -mwindows
        -lcomctl32 -lversion -loleaut32 -lstdc++

        win xp sp2
      • Bram Moolenaar
        ... I cannot reproduce it. Please have it crash in a debugger so that we can see where it happens. Can you make it crash with vim -u NONE ? If not then
        Message 3 of 3 , Jan 6, 2007
        • 0 Attachment
          Thomas wrote:

          > The following code makes vim crash sometimes.
          >
          > fun! MakeVimCrash()
          > redir => lets
          > silent let
          > redir END
          > endf
          > call MakeVimCrash()
          >
          > It doesn't crash always. Sometimes I have to call the function twice.
          >
          > I now ran a few more tests. It appears that vim is more likely to crash
          > when loading more plugins. When I remove plugins, I can call the
          > function more often. I'm not able to pin it down this problem to one
          > specific plugin though.

          I cannot reproduce it. Please have it crash in a debugger so that we
          can see where it happens.

          Can you make it crash with "vim -u NONE"? If not then perhaps some of
          your settings or startup scripts matter. Perhaps there is a variable
          with a special value that causes a problem for ":let". E.g., a list or
          dictionary with a recursive reference. Try ":unlet" (if you can
          reproduce the crash).

          --
          Never under any circumstances take a sleeping pill
          and a laxative on the same night.

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
          \\\ download, build and distribute -- http://www.A-A-P.org ///
          \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
        Your message has been successfully submitted and would be delivered to recipients shortly.