xavierd / clang_complete

Vim plugin that use clang for completing C/C++ code.
http://www.vim.org/scripts/script.php?script_id=3302
1.96k stars 308 forks source link

Crash with clang from Homebrew, OK with clang from xcode #435

Closed miquelbeltran closed 4 years ago

miquelbeltran commented 9 years ago

Happens if I use clang from homebrew (I've installed it for clang-format)

But it is OK when using clang from xcode.app.

Crashes: let g:clang_library_path = "/usr/local/Cellar/llvm/3.5.0_2/lib/" Works: let g:clang_library_path = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/"

The crash I get:

$ vim source.cpp
Vim: Caught deadly signal ABRT

Exception KeyError: KeyError(4352331776,) in <module 'threading' from '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.pyc'> ignoredVim: Finished.

Abort trap: 6

This does not happen for all files, just for some of them. I cannot share my source files, but I can provide any more information needed and test things. If I remove the plugin I don't have crashes.

My .vimrc

vim version output:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan  4 2015 18:17:41)
MacOS X (unix) version
Included patches: 1-488
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl             +cmdline_info    +emacs_tags      -hangul_input    +menu            +mouse_xterm     -python3         +syntax          +virtualedit     -xsmp
+arabic          +comments        +eval            +iconv           +mksession       +multi_byte      +quickfix        +tag_binary      +visual          -xterm_clipboard
+autocmd         +conceal         +ex_extra        +insert_expand   +modify_fname    +multi_lang      +reltime         +tag_old_static  +visualextra     -xterm_save
-balloon_eval    +cryptv          +extra_search    +jumplist        +mouse           -mzscheme        +rightleft       -tag_any_white   +viminfo         -xpm
-browse          +cscope          +farsi           +keymap          -mouseshape      +netbeans_intg   +ruby            -tcl             +vreplace
++builtin_terms  +cursorbind      +file_in_path    +langmap         +mouse_dec       +path_extra      +scrollbind      +terminfo        +wildignore
+byte_offset     +cursorshape     +find_in_path    +libcall         -mouse_gpm       +perl            +signs           +termresponse    +wildmenu
+cindent         +dialog_con      +float           +linebreak       -mouse_jsbterm   +persistent_undo +smartindent     +textobjects     +windows
-clientserver    +diff            +folding         +lispindent      +mouse_netterm   +postscript      -sniff           +title           +writebackup
+clipboard       +digraphs        -footer          +listcmds        +mouse_sgr       +printer         +startuptime     -toolbar         -X11
+cmdline_compl   -dnd             +fork()          +localmap        -mouse_sysmouse  +profile         +statusline      +user_commands   -xfontset
+cmdline_hist    -ebcdic          -gettext         -lua             +mouse_urxvt     +python          -sun_workshop    +vertsplit       -xim
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: /usr/bin/clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX  -Os -w -pipe -march=native -mmacosx-version-min=10.10 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: /usr/bin/clang   -L. -L/usr/local/lib -L/usr/local/lib -Wl,-headerpad_max_install_names -o vim        -lm  -lncurses -liconv -framework Cocoa   -fstack-protector  -L/System
/Library/Perl/5.18/darwin-thread-multi-2level/CORE -lperl -framework Python   -lruby.2.0.0 -lobjc
Press ENTER or type command to continue

I guess this is important information for the project, but not a blocking issue.

JohnTortugo commented 9 years ago

Got the same error here

xaizek commented 9 years ago

Given that python bindings to libclang were updated three years ago, it's not very surprising. The library probably returns enumeration value, which binging part tries to map, but there is no such value.

I guess it should be possible to update the bindings, but there were some discussion about breaking C interface between releases of LLVM, which might be related to Clang as well, so version hell is near.