Vim 7.4.1710 syntax on always Segmentation fault

70 views
Skip to first unread message

Nelson Yeung

unread,
Apr 5, 2016, 2:04:25 PM4/5/16
to vim_dev
Link to my original question: http://superuser.com/questions/1061455/vim-7-4-with-syntax-on-will-always-caught-deadly-signal-segv

With `syntax on` inside `.vimrc` (that's the only line in my `.vimrc` file), opening a file with any sort of syntax highlighting will cause

Vim: Caught deadly signal SEGV

Vim: Finished.
Segmentation fault

If I created a new file, i.e., `vim test.py`, then simply type one of these characters: `#` `'` `"` `@` `\`, the above error would immediate happen along with `Vim: preserving files...`. Or indeed if I type anything that will trigger a syntax highlighting would cause the segmentation fault. Hence typing code such as `if` will also crash Vim.

I don't have sudo, hence I have to build it myself. The compilation steps:

git clone https://github.com/vim/vim.git
cd vim
./configure --prefix=$HOME/local --with-features=huge --enable-rubyinterp --enable-pythoninterp --enable-python3interp --enable-perlinterp --enable-luainterp
make
make install

Vim version output `vim --version`:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Apr 5 2016 01:08:47)
Included patches: 1-1710
Compiled by ...
Huge version with GTK2 GUI. Features included (+) or not (-):
+acl +farsi +mouse_netterm +tag_binary
+arabic +file_in_path +mouse_sgr +tag_old_static
+autocmd +find_in_path -mouse_sysmouse -tag_any_white
+balloon_eval +float +mouse_urxvt -tcl
+browse +folding +mouse_xterm +terminfo
++builtin_terms -footer +multi_byte +termresponse
+byte_offset +fork() +multi_lang +textobjects
+channel +gettext -mzscheme +timers
+cindent -hangul_input +netbeans_intg +title
+clientserver +iconv +packages +toolbar
+clipboard +insert_expand +path_extra +user_commands
+cmdline_compl +job +perl +vertsplit
+cmdline_hist +jumplist +persistent_undo +virtualedit
+cmdline_info +keymap +postscript +visual
+comments +langmap +printer +visualextra
+conceal +libcall +profile +viminfo
+cryptv +linebreak +python/dyn +vreplace
+cscope +lispindent +python3/dyn +wildignore
+cursorbind +listcmds +quickfix +wildmenu
+cursorshape +localmap +reltime +windows
+dialog_con_gui +lua +rightleft +writebackup
+diff +menu +ruby +X11
+digraphs +mksession +scrollbind -xfontset
+dnd +modify_fname +signs +xim
-ebcdic +mouse +smartindent +xsmp_interact
+emacs_tags +mouseshape +startuptime +xterm_clipboard
+eval +mouse_dec +statusline -xterm_save
+ex_extra +mouse_gpm -sun_workshop +xpm
+extra_search -mouse_jsbterm +syntax

OS info:

SUSE Enterprise
Linux 3.0.101-68-default x86_64
KDE: 4.3.5

Tried with `--noplugin`, same problem.

Tried compiling it again with no extra features, i.e., `./configure --prefix=$HOME/local && make && make install`, same problem.

Christian Brabandt

unread,
Apr 5, 2016, 2:06:49 PM4/5/16
to vim_dev
Hi Nelson!
So just calling vim -u NONE -N --cmd ':syntax on' file.py
does cause a segfault? Can you post a backtrace please (uncomment the
debug statement in the makefile before recompiling please).


Best,
Christian
--
Die Frau verliert in der Liebe zu einem ausgezeichneten Manne das
Bewußtsein ihres eigenen Wertes; der Mann kommt erst recht zum
Bewußtsein des seinen durch die Liebe einer edlen Frau.
-- Marie von Ebner-Eschenbach

Dominique Pellé

unread,
Apr 5, 2016, 2:29:59 PM4/5/16
to vim_dev
Maybe configure did not add the -D_FORTIFY_SOURCE=1
compilation flag. Without it, Vim crashes at start-up. It's not a bug
in Vim. Some distributions (Ubuntu at least, but I don't know
about SUSE) have patched gcc to compile by default with
-D_FORTIFY_SOURCE=2 which is known to break some
valid C programs like Vim.

Regards
Dominique

Nelson Yeung

unread,
Apr 5, 2016, 5:36:37 PM4/5/16
to vim_dev
Hi Christian,

I've just tried compiling by uncomment out the following line:
"CFLAGS = -g -DDEBUG -Wall -Wshadow -Wmissing-prototypes"
it actually made it work.
When I slowly remove the individual flag to see what is fixing it, I discovered that it's option "-g" that made it work. That is to say including "CFLAGS = -g", then compiling fixes my vim.

Do you still need me to compile vim without -g but with debug and get the backtrace?

Kind regards,
Nelson
Reply all
Reply to author
Forward
0 new messages