Gvim Segfault when using Syntastic

523 views
Skip to first unread message

Daniel Hunt

unread,
Feb 20, 2012, 3:19:45 PM2/20/12
to vim_dev
Following on from a bug report I made on the Syntastic issue list:
https://github.com/scrooloose/syntastic/issues/151
"When the error list window is open, along with the file it was opened
with, you can cause a segfault to happen by just quitting the source
file (while the error list is still open)
This doesn't happen when a second file (either with, or without an
error window) - only when it is the last file open."

... The developer there believes that this is a vim issue, and not a
syntastic one, so I'm posting this here in the hope that something
useful comes of it!

mvim --version:
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jan 18 2012 09:35:39)
MacOS X (unix) version
Included patches: 1-390
Compiled by dan...@Daniel-Hunts-MacBook-Pro.local
Huge version with MacVim 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()
+fullscreen
-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 +mouse_urxvt +multi_byte
+multi_lang -mzscheme +netbeans_intg +odbeditor +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
+transparency
+user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
+vreplace
+wildignore +wildmenu +windows +writebackup -X11 -xfontset +xim -xsmp
-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: "/Applications/MacVim.app/Contents/Resources/
vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -
Wall -Wno-unknown-pragmas -pipe -DMACOS_X_UNIX -no-cpp-precomp -g -
O2 -arch x86_64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -I/System/
Library/Frameworks/Tcl.framework/Headers -D_REENTRANT=1 -
D_THREAD_SAFE=1 -D_DARWIN_C_SOURCE=1
Linking: gcc -L. -L. -arch x86_64 -L/usr/local/lib -o Vim -
framework Cocoa -framework Carbon -lncurses -liconv -framework
Cocoa -fstack-protector -L/usr/local/lib -L/System/Library/Perl/
5.12/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -framework
Python -F/System/Library/Frameworks -framework Tcl -framework
CoreFoundation -framework Ruby

.... and vim --version:
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jun 24 2011 20:00:09)
Compiled by ro...@apple.com
Normal 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
-xterm_clipboard -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -D_FORTIFY_SOURCE=0 -Iproto -DHAVE_CONFIG_H -
arch i386 -arch x86_64 -g -Os -pipe
Linking: gcc -arch i386 -arch x86_64 -o vim -lncurses

Daniel

Bram Moolenaar

unread,
Feb 20, 2012, 4:37:00 PM2/20/12
to Daniel Hunt, vim_dev

Daniel Hunt wrote:

> Following on from a bug report I made on the Syntastic issue list:
> https://github.com/scrooloose/syntastic/issues/151
> "When the error list window is open, along with the file it was opened
> with, you can cause a segfault to happen by just quitting the source
> file (while the error list is still open)
> This doesn't happen when a second file (either with, or without an
> error window) - only when it is the last file open."
>
> ... The developer there believes that this is a vim issue, and not a
> syntastic one, so I'm posting this here in the hope that something
> useful comes of it!
>
> mvim --version:
> VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jan 18 2012 09:35:39)
> MacOS X (unix) version
> Included patches: 1-390
> Compiled by dan...@Daniel-Hunts-MacBook-Pro.local
> Huge version with MacVim GUI. Features included (+) or not (-):

I can't reproduce it. If someone can, please use gdb to get a stack
trace.


--
Ed's Radiator Shop: The Best Place in Town to Take a Leak.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Daniel Hunt

unread,
Feb 20, 2012, 4:44:47 PM2/20/12
to Bram Moolenaar, vim_dev
If you want to give me a quick guide, I'll happily do it for you. It's
100% reproducible here for me

Lech Lorens

unread,
Feb 20, 2012, 4:51:39 PM2/20/12
to vim...@googlegroups.com
On 20 February 2012 22:44, Daniel Hunt <danie...@gmail.com> wrote:
> If you want to give me a quick guide, I'll happily do it for you. It's
> 100% reproducible here for me

Please, do not top-post on this list. It makes it harder to make sense
of a quoted conversation. Thanks!


> On Mon, Feb 20, 2012 at 9:37 PM, Bram Moolenaar <Br...@moolenaar.net> wrote:
>> I can't reproduce it.  If someone can, please use gdb to get a stack
>> trace.


The thing Daniel seems to have forgotten to mention is that this
requires an autocommand:

autocmd BufWinLeave * if empty(&bt) | lclose | endif

100% reproducible for me as well.

--
Pozdrawiam,
Lech Lorens

Taylor Hedberg

unread,
Feb 20, 2012, 4:56:24 PM2/20/12
to vim...@googlegroups.com, Bram Moolenaar
Daniel Hunt, Mon 2012-02-20 @ 21:44:47+0000:

> If you want to give me a quick guide, I'll happily do it for you. It's
> 100% reproducible here for me

I don't know whether gdb comes installed by default on a Mac or if you
have to install it manually. Either way, make sure you have it, then:

1. Build Vim with debugging symbols (`make CFLAGS=-g`) and install
2. In the shell, type `gdb gvim`
3. At the "(gdb)" prompt, type `run`. Gvim should start.
4. Cause the error to occur. The gdb terminal should display a
message like "Program received SIGSEGV...".
5. Type `bt` at the "(gdb)" prompt to produce a backtrace

signature.asc

Lech Lorens

unread,
Feb 20, 2012, 5:10:07 PM2/20/12
to vim...@googlegroups.com
On 20 February 2012 22:37, Bram Moolenaar <Br...@moolenaar.net> wrote:
> I can't reproduce it.  If someone can, please use gdb to get a stack
> trace.
>

Sending in a backtrace just in case:

(gdb) bt
#0 0x0815b0a5 in update_screen (type=40) at screen.c:475
#1 0x081e739a in main_loop (cmdwin=0, noexmode=0) at main.c:1185
#2 0x081e6fcd in main (argc=3, argv=0xbffff0f4) at main.c:986

In this code snippet:

/*
* Correct stored syntax highlighting info for changes in each displayed
* buffer. Each buffer must only be done once.
*/
FOR_ALL_WINDOWS(wp)
{
if (wp->w_buffer->b_mod_set)
{
# ifdef FEAT_WINDOWS
win_T *wwp;

it it the line that checks whether wb->w_buffer->b_mod_set is non-zero:
if (wp->w_buffer->b_mod_set)

wp->w_buffer is NULL.

--
Pozdrawiam,
Lech Lorens

Daniel Hunt

unread,
Feb 20, 2012, 5:13:04 PM2/20/12
to vim...@googlegroups.com
On Mon, Feb 20, 2012 at 10:10 PM, Lech Lorens <lech....@gmail.com> wrote:
> On 20 February 2012 22:37, Bram Moolenaar <Br...@moolenaar.net> wrote:
>> I can't reproduce it.  If someone can, please use gdb to get a stack
>> trace.
>>
>
> Sending in a backtrace just in case:
>
> (gdb) bt
> #0  0x0815b0a5 in update_screen (type=40) at screen.c:475
> #1  0x081e739a in main_loop (cmdwin=0, noexmode=0) at main.c:1185
> #2  0x081e6fcd in main (argc=3, argv=0xbffff0f4) at main.c:986

And just for good measure, my own one too:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x00000000000000b8
0x000000010010fde3 in update_screen ()
(gdb) bt
#0 0x000000010010fde3 in update_screen ()
#1 0x000000010018fd40 in main_loop ()
#2 0x0000000100193c72 in main ()

(I haven't compiled vim with the debugging symbols, but it may not be
necessary now that we've confirmed it's in the same place across
systems?)

Bram Moolenaar

unread,
Feb 22, 2012, 8:11:28 AM2/22/12
to Lech Lorens, vim...@googlegroups.com

Lech Lorens wrote:

OK, I can reproduce it now. I was using a quickfix window, and "cclose"
has the same problem.

The stack trace at the time of the crash doesn't show what happens, it's
probably because the quickfix window is closed while closing the other
window.

--
How many light bulbs does it take to change a person?

Daniel Hunt

unread,
Mar 11, 2012, 7:26:06 PM3/11/12
to vim...@googlegroups.com, Lech Lorens
On Wednesday, February 22, 2012 1:11:28 PM UTC, Bram Moolenaar wrote:

> Lech Lorens wrote:
> OK, I can reproduce it now. I was using a quickfix window, and "cclose"
> has the same problem.
>
> The stack trace at the time of the crash doesn't show what happens, it's
> probably because the quickfix window is closed while closing the other
> window.

Without wanting to be a pain - any progress on this?

Dan

James McCoy

unread,
Mar 11, 2012, 7:32:32 PM3/11/12
to vim...@googlegroups.com

It was fixed in patch 7.3.449.
http://ftp.vim.org/pub/vim/patches/7.3/7.3.449

--
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <jame...@jamessan.com>

signature.asc

Daniel Hunt

unread,
Mar 11, 2012, 7:42:16 PM3/11/12
to vim...@googlegroups.com
On Sunday, March 11, 2012 11:32:32 PM UTC, James McCoy wrote:
> > Without wanting to be a pain - any progress on this?
>
> It was fixed in patch 7.3.449.
> http://ftp.vim.org/pub/vim/patches/7.3/7.3.449
>

Ah I see - thank you!

Looks like I'll have to wait a while to see it filter through to brew on OSX.

Cheers again,
Dan

Taylor Hedberg

unread,
Mar 11, 2012, 8:24:28 PM3/11/12
to vim...@googlegroups.com
Daniel Hunt, Sun 2012-03-11 @ 16:42:16-0700:

> Looks like I'll have to wait a while to see it filter through to brew
> on OSX.

You can always compile it yourself straight from Mercurial. A lot of
people prefer to do that to stay more up-to-date with new patches.

Reply all
Reply to author
Forward
0 new messages