tpope/vim-rails — Issue #128: vim can be crashed when rails and matchit are installed
Author: graudeejs
Created: 2011-11-07 10:25:51+00:00
State: open

Recently I experienced quite few vim crashes (unbelievable, but fact).
Today I found out where these come from.

vim-rails + matchit is deadly combination.

When both are installed, open some view that contains lines such as:
```
$("#add_permission_form").html("#{escape_javascript( render :partial => "form_add_permission", :layout => false )}");
```

now when cursor is on render.... part, and you git "gf" to go to form_add_permission partial (which doesn't exist [In my case it exists, but I use haml, and vim-rails doesn't find it]).
At the bottom of screen you get:
```
E345 Cannon find file "_form_add_permission" in path
```
now in few seconds (about 10-30) vim will crash (you can open other view/controller meanwhile, but crash is inevitable)

```
Vim: Finished.
Bus error
```

and virtual terminal (xterm) is corrupted (at least this time): when I try to select something with mouse or simply click with any mouse button, it types various characters.

This is probably matchit bug, but since it's triggered by vim-rails feature I report it here. Besides I've no idea if anyone is maintaining matchit.

I tried matchit that comes with vim and the one from https://github.com/mhz/vim-matchit, both crash

Misc info
OS: FreeBSD 8.2-STABLE
vim-rails: latest from git
```
$ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep 29 2011 09:54:24)
Included patches: 1-121
Compiled by graudeejs@work.pc
Big version with GTK2 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_gui +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: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: cc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -D_THREAD_SAFE -D_REENTRANT -I/usr/local/include/gtk-2.0 -I/usr/local/lib/gtk-2.0/include -I/usr/local/include/atk-1.0 -I/usr/local/include/cairo -I/usr/local/include/gdk-pixbuf-2.0 -I/usr/local/include/pango-1.0 -I/usr/local/include/gio-unix-2.0/ -I/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/drm -I/usr/local/include -O2 -pipe -fno-strict-aliasing -D_FORTIFY_SOURCE=1
Linking: cc -L/usr/local/lib -lXt -L. -rpath=/usr/lib:/usr/local/lib -pthread -rdynamic -L/usr/local/lib -Wl,--as-needed -o vim -pthread -L/usr/local/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lpangocairo-1.0 -lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lgdk_pixbuf-2.0 -lpangoft2-1.0 -lgio-2.0 -lXfixes -lcairo -lX11 -lpango-1.0 -lm -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lSM -lICE -lXpm -lXt -lXdmcp -lSM -lICE -lm -lelf -pthread -ltermlib -liconv -lintl -L/usr/local/lib/python2.7/config -lpython2.7 -lutil -lm -Wl,--export-dynamic -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby19 -lcrypt -lm -L/usr/local/lib -rpath=/usr/lib:/usr/local/lib -pthread
```

My entire vim config: https://github.com/graudeejs/dot.vim