Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Vim Crashes #228

Open
ssbanerje opened this Issue Jan 9, 2013 · 21 comments

Comments

Projects
None yet
5 participants

I am using the system supplied gvim (7.3) in Ubuntu 12.10. As well as the system supplied libclang(3.0-6ubuntu3). Now whenever I try to type in some code like this -

#include <iostream>
#include <assert.h>

#include "opencv2/highgui/highgui.hpp"

using namespace std;


int main(int argc, const char *argv[]) {
  cv::
}

The program crashes and I get to see this on the terminal output (this seems to happen only in gvim and not in vim and macvim), If I prevent the clang_complete module from being loaded, then things work fine.

Vim: Caught deadly signal SEGV
Vim: Finished.
  1 �|77H                                                                                                                                                   �|1;0M  2 �|78H                                                                                                                                                   �|103H�|3;3M �|77H                                      �|4;3M �|77H                                      �|5;3M �|77H                                          �|7;3M �|77H                    �|9;3M �|77H                                        �|10;5M                            �|11;5M                             �|12;5M                                                  �|13;5M                    �|14;5M                            �|15;5M                                                                   �|16;5M                        �|18;5M                       �|19;5M                �|20;5M                                               �|21;5M                              �|22;5M                                    �|23;5M                                   �|24;7M                      �|25;11M                                   �|26;11M                                                                  �|27;11M                          �|28;5M  �|30;5M                   �|31;5M                            �|32;5M                                     �|33;5M                               �|34;5M                �|35;5M          �|36;3M �|77H �|37;137M5�|132H�|37;146M2�|141H:�|1;4  2 �|77H                                                                                                                                                   �|2;0M  3 �|78H                                                                                                                                     3 �|77H                                                                                                                                                   �|3;0M  4 �|78H                                                                                                                                     4 �|77H                                                                                                                                                   �|4;0M  5 �|78H                                                                                                                                     5 �|77H                                                                                                                                                   �|5;0M  6 �|78H                                                                                                                                     6 �|77H                                                                                                                                                   �|6;0M  7 �|78H                                                                                                                                     7 �|77H                                                                                                                                                   �|7;0M  8 �|78H                                                                                                                                     8 �|77H                                                                                                                                                   �|8;0M  9 �|78H                                                                                                                                     9 �|77H                                                                                                                                                   �|9;0M 10 �|78H                                                                                                                                    10 �|77H                                                                                                                                                   �|10;0M 11 �|78H                                                                                                                                   11 �|77H                                                                                                                                                   �|11;0M 12 �|78H                                                                                                                                   12 �|77H                                                                                                                                                   �|12;0M 13 �|78H                                                                                                                                   13 �|77H                                                                                                                                                   �|13;0M 14 �|78H                                                                                                                                   14 �|77H                                                                                                                                                   �|14;0M 15 �|78H                                                                                                                                   15 �|77H                                                                                                                                                   �|15;0M 16 �|78H                                                                                                                                   16 �|77H                                                                                                                                                   �|16;0M 17 �|78H                                                                                                                                   17 �|77H                                                                                                                                                   �|17;0M 18 �|78H                                                                                                                                   18 �|77H                                                                                                                                                   �|18;0M 19 �|78H                                                                                                                                   19 �|77H                                                                                                                                                   �|19;0M 20 �|78H                                                                                                                                   20 �|77H                                                                                                                                                   �|20;0M 21 �|78H                                                                                                                                   21 �|77H                                                                                                                                                   �|21;0M 22 �|78H                                                                                                                                   22 �|77H                                                                                                                                                   �|22;0M 23 �|78H                                                                                                                                   23 �|77H                                                                                                                                                   �|23;0M 24 �|78H                                                                                                                                   24 �|77H                                                                                                                                                   �|24;0M 25 �|78H                                                                                                                                   25 �|77H                                                                                                                                                   �|25;0M 26 �|78H                                                                                                                                   26 �|77H                                                                                                                                                   �|26;0M 27 �|78H                                                                                                                                   27 �|77H                                                                                                                                                   �|27;0M 28 �|78H                                                                                                                                   28 �|77H                                                                                                                                                   �|28;0M 29 �|78H                                                                                                                                   29 �|77H                                                                                                                                                   �|29;0M 30 �|78H                                                                                                                                   30 �|77H                                                                                                                                                   �|30;0M 31 �|78H                                                                                                                                   31 �|77H                                                                                                                                                   �|31;0M 32 �|78H                                                                                                                                                   �|103H�|37;137M4�|132H�|37;146M2�|141H:�|31;4M�|0;36R�|142H�|36;0M
�|0;38R�|0;150V�|30;0M 32 �|77H                                                                                                                                                   �|31;0M 33 �|78H                                                                                                             33 �|77H                                                                                                                                                   �|32;0M 34 �|78H                                                                                                                                                   �|103H�|37;137M9�|132H�|37;146M4�|141H:�|32;4M

My clang_complete variables in vim are the following -

let g:clang_complete_copen = 1
let g:clang_complete_library = 1
let g:clang_complete_pattern = 1
let g:clang_complete_macro = 1

The details of the vim compilation

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 26 2012 16:45:32)
Included patches: 1-547
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by buildd@
Huge version with GTK2-GNOME 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 +mouse_urxvt +multi_byte +multi_lang -mzscheme 
+netbeans_intg +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/share/vim"
Compilation: gcc-4.6 -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12   -pthread -DORBIT2=1 -D_REENTRANT -I/usr/include/libgnomeui-2.0 -I/usr/include/libart-2.0 -I/usr/include/gconf/2 -I/usr/include/gnome-keyring-1 -I/usr/include/libgnome-2.0 -I/usr/include/libbonoboui-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gtk-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/x86_64-linux-gnu/gnome-vfs-2.0/include -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/libxml2 -I/usr/include/pango-1.0 -I/usr/include/gail-1.0 -I/usr/include/freetype2 -I/usr/include/atk-1.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/cairo -I/usr/include/gio-unix-2.0/ -I/usr/include/pixman-1 -I/usr/include/libpng12     -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1     -I/usr/include/tcl8.5  -D_REENTRANT=1  -D_THREAD_SAFE=1  -D_LARGEFILE64_SOURCE=1  
Linking: gcc-4.6   -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -rdynamic -Wl,-export-dynamic  -Wl,-E  -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,--as-needed -o vim   -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0     -lgnomeui-2 -lSM -lICE -lbonoboui-2 -lgnomevfs-2 -lgnomecanvas-2 -lgnome-2 -lpopt -lbonobo-2 -lbonobo-activation -lORBit-2 -lart_lgpl_2 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgconf-2 -lgthread-2.0 -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0   -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lnsl  -lselinux  -lacl -lattr -lgpm -ldl  -L/usr/lib -llua5.1  -Wl,-E  -fstack-protector -L/usr/local/lib  -L/usr/lib/perl/5.14/CORE -lperl -ldl -lm -lpthread -lcrypt -L/usr/lib/python2.7/config -lpython2.7 -lpthread -ldl -lutil -lm -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions  -L/usr/lib -ltcl8.5 -ldl -lpthread -lieee -lm -lruby-1.9.1 -lpthread -lrt -ldl -lcrypt -lm  -L/usr/lib 
Owner

Rip-Rip commented Jan 12, 2013

Hey, could you try compiling a more recent version of vim, and retry? Plus, could you try not using the libclang path? It seems that you're not the only one having the libclang path crashing lately…

Thanks!

Plus, could you try not using the libclang path?

How do I do this?

Also, I tried recompiling Vim --> It gives me the same errors

Owner

Rip-Rip commented Jan 12, 2013

To disable libclang: let g:clang_complete_library = 0

Collaborator

tobig commented Jan 12, 2013

You mean g:clang_use_library = 0?

Owner

Rip-Rip commented Jan 12, 2013

Obviously yes...

This seems to fix the problem with Vim crashing...
But now I do not get autocomplete on any of the libraires(except stl) I am using

Collaborator

tobig commented Jan 13, 2013

Can you give it another try with the latest changes merged yesterday. Your only clang flags should be, g:lang_use_library = 1 and g:clang_debug = 1 (and g:clang_library_path if necessary). Does it still crash?

At which point does it crash? Right when opening a file or when doing the first completion?

I am also running ubuntu and just yesterday tested the very same version of libclang and vim. I did not see any errors.

This seems to give me two types of errors ---

  • When I start vim, sometimes it is crashing with this message --
╭─subho@Mindstorm  ~/Documents/Workshop/CV-Assignment1/src  
╰─$ gvim problem* *.h 
 [xcb] Unknown request in queue while dequeuing
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
gvim: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.
gvim: ../../src/xcb_io.c:178: dequeue_pending_request: Assertion `!xcb_xlib_unknown_req_in_deq' failed.
Vim: Caught deadly signal ABRT

Vim: Finished.
Error detected while processing function ClangComplete:
line   35:
Traceback (most recent call last):
Press ENTER or type command to continue
Error detected while processing function ClangComplete:
line   35:
  File "<string>", line 1, in <module>
Press ENTER or type command to continue
Error detected while processing function ClangComplete:
line   35:
  File "/home/subho/.vim/bundle/clang_complete/plugin/libclang.py", line 384, in
 getCurrentCompletions
Press ENTER or type command to continue
Error detected while processing function ClangComplete:
line   35:
    timer = CodeCompleteTimer(debug, vim.current.buffer.name, line, column)
Press ENTER or type command to continue
Error detected while processing function ClangComplete:
line   35:
  File "/home/subho/.vim/bundle/clang_complete/plugin/libclang.py", line 44, in
__init__
Press ENTER or type command to continue
Error detected while processing function ClangComplete:
line   35:
    print "Command: clang %s -fsyntax-only " % " ".join(getCompileArgs()),
Press ENTER or type command to continue
Error detected while processing function ClangComplete:
line   35:
NameError: global name 'getCompileArgs' is not defined
Press ENTER or type command to continue
Error detected while processing function ClangComplete:
line   36:
Traceback (most recent call last):
Press ENTER or type command to continue
Error detected while processing function ClangComplete:
line   36:
  File "<string>", line 1, in <module>
Press ENTER or type command to continue
....
....
....
....

I also have a MacVim installation under exactly the same(vimrc) configuration and that works fine.

Collaborator

tobig commented Jan 13, 2013

I need to think more about the first error. The second is a merge error that was not yet fixed in trunk.

Can you try to apply this patch tobig/clang_complete@f57879d or directly this branch:
https://github.com/tobig/clang_complete/tree/smoother_libclang_user_experience

Owner

Rip-Rip commented Jan 15, 2013

No need to use @tobig branch anymore, I just merged his changes :). A git pull should be enough.

Owner

Rip-Rip commented Jan 15, 2013

@tobig. Strangely enough, enabling g:clang_debug, and trying to complete on gvim (not vim), will always crash, with the same errors.

I am just curious, do you guys have an older version(revision) which I can revert back to, to get a working editor on linux. And then switch back to the HEAD once this issue has been fixed.

If I have to go back one version on vim or on libclang, that would be fine too.

Owner

Rip-Rip commented Jan 18, 2013

Honestly @subszero, we have no way of knowing which commit is stable, since what is stable for us may not be the case for you. What I would suggest you to do, since you can reproduce that crash every time, is to bisect clang_complete, that way, it will be much easier for us to fix the bug. Don't know if that can help you, but I've noticed that vim (the console program), is less prone to those segfault, so you could also try using it.

Owner

Rip-Rip commented Jan 18, 2013

Can you also test the code that I send on pull request #239? It may solve the issue.

@Rip-Rip : that(#239) does not seem to fix the problem. Vim is still crashing.

Heorhiy commented Jan 29, 2013

I also have the same issue. Vim crash occasionally.

Owner

Rip-Rip commented Jan 30, 2013

@Heorhiy: Could you try getting a backtrace of vim when it's happening? It would also be great if you could bisect clang_complete. Knowing the commit that causes this issue will be very useful.
Thanks.

Are you guys any closer to solving this?

After applying the latest commits, I now get this -
screenshot

Vim doesn't crash anymore and spit out weird characters, but it would be nice to go back to using the completion. 😃

Collaborator

tobig commented Feb 25, 2013

On 02/25/2013 11:07 AM, Subho Banerjee wrote:

Are you guys any closer to solving this?

After applying the latest commits, I now get this -
screenshot

Vim doesn't crash anymore and spit out weird characters, but it would be nice to go back to using the completion. 😃

Not really. You could help by finding a working version in the past and
bisecting to the commit that introduced the problem. Do you know how to
work with 'git bisect'?

Tobi

Ya sure... I'll try to do what I can!

On Mon, Feb 25, 2013 at 3:43 PM, Tobias Grosser notifications@github.comwrote:

On 02/25/2013 11:07 AM, Subho Banerjee wrote:

Are you guys any closer to solving this?

After applying the latest commits, I now get this -
screenshot

Vim doesn't crash anymore and spit out weird characters, but it would be
nice to go back to using the completion. 😃

Not really. You could help by finding a working version in the past and
bisecting to the commit that introduced the problem. Do you know how to
work with 'git bisect'?

Tobi


Reply to this email directly or view it on GitHubhttps://github.com/Rip-Rip/clang_complete/issues/228#issuecomment-14033858.

stewing commented Feb 10, 2014

I had a similar problem with a vim segv when I loaded a C++ file. When I bisected, I found this commit was causing a the problem: 162279c. Moving to the previous revision creates some vim errors, but the process doesn't segv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment