New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vim: Caught deadly signal ABRT #1351

Closed
benmezger opened this Issue Jan 31, 2015 · 23 comments

Comments

Projects
None yet
7 participants
@benmezger

benmezger commented Jan 31, 2015

Before I was using vim's homebrew version with YCM, which worked fine, I decided to move to macports, but since I saw other issues with YCM and macports, I compiled vim by hand.

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 31 2015 15:32:01)
MacOS X (unix) version
Included patches: 1-608
Compiled by ephexeve@ephexeve
Huge version without GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +syntax
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
-balloon_eval    +float           +mouse_urxvt     -tag_any_white
-browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         -gettext         -mzscheme        +textobjects
-clientserver    -hangul_input    +netbeans_intg   +title
+clipboard       +iconv           +path_extra      -toolbar
+cmdline_compl   +insert_expand   -perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       +python          +viminfo
-cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      -lua             +rightleft       +windows
+diff            +menu            -ruby            +writebackup
+digraphs        +mksession       +scrollbind      -X11
-dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     -xim
+emacs_tags      -mouseshape      -sniff           -xsmp
+eval            +mouse_dec       +startuptime     -xterm_clipboard
+ex_extra        -mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    -xpm
   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: "/Users/ephexeve/Workspace/builds/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc    -o vim        -lm -lncurses  -liconv -framework Cocoa    -framework Python

Running vim without YCM works fine, after installing YCM with clang-completer, I get a deadly signal ABRT, checking the trace in lldb (OSX), I get;


                                                                               Fatal Python error: PyThreadState_Get: no current thread
Process 50429 stopped
* thread #1: tid = 0x1c635, 0x00007fff85c40866 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00007fff85c40866 libsystem_kernel.dylib`__pthread_kill + 10
libsystem_kernel.dylib`__pthread_kill + 10:
-> 0x7fff85c40866:  jae    0x7fff85c40870            ; __pthread_kill + 20
   0x7fff85c40868:  movq   %rax, %rdi
   0x7fff85c4086b:  jmp    0x7fff85c3d175            ; cerror_nocancel
   0x7fff85c40870:  retq
(lldb)

As I stated, I compiled vim by hand, downloaded vim's source from their webpage and compiled. Macports python27 version is selected to default.

Also, I tried using Macvim, and got the same problem, a deadly signal.

Log of install.sh -> https://bpaste.net/show/57655d61486f

@vheon

This comment has been minimized.

Collaborator

vheon commented Jan 31, 2015

This is a problem with your machine, not a YCM bug. I have to close.

@vheon vheon closed this Jan 31, 2015

@benmezger

This comment has been minimized.

benmezger commented Jan 31, 2015

My machine? How did homebrew's version of Vim worked?

@vheon

This comment has been minimized.

Collaborator

vheon commented Jan 31, 2015

That kind of error is not an error with YCM itself but with the way vim is compiled respectively with the python interpreter. So it is a problem with your machine configuration.

@oblitum

This comment has been minimized.

Contributor

oblitum commented Jan 31, 2015

My machine? How did homebrew's version of Vim worked?

@ephexeve because this: https://code.google.com/p/vim/issues/detail?id=315. I compile vim from sources and I have to fix that so that the build picks the correct python. The current codebase has that bug on OS X. Homebrew somehow picks the right python while building.

@oblitum

This comment has been minimized.

Contributor

oblitum commented Jan 31, 2015

@ephexeve offtopic. I understand one moving from homebrew to Nix, but to macports?? That sounds like a downgrade.

@vheon

This comment has been minimized.

Collaborator

vheon commented Jan 31, 2015

OT: @oblitum I didn't knew about Nix, thanks :)

@oblitum

This comment has been minimized.

Contributor

oblitum commented Jan 31, 2015

@vheon cheers. I didn't try it myself, I know some people like it for having a reproducible setup, both for OS X and Linux.

@benmezger

This comment has been minimized.

benmezger commented Jan 31, 2015

@oblitum, hmm, I see, so there is not way to get this working? I tried checking how homebrew does.. Thanks. About Macports, because I want to set compilation flags easily. For example, I installed mutt with homebrew and I couldn't get it working with +sidebar_patch, with macports, easily. Cheers.

@oblitum

This comment has been minimized.

Contributor

oblitum commented Jan 31, 2015

@ephexeve there's, you just fix that line in the build scripts (this is what I do).

@oblitum

This comment has been minimized.

Contributor

oblitum commented Jan 31, 2015

@ephexeve since you're compiling it yourself from sources it shoudn't be a problem. You should use vim --version to check your compilation is linked against the correct python version. Which means the same that will be used by YCM and other python plugins. All should be loading the same python version.

For example, my vim shows:

Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX  -I/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/include/python2.7 -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang   -L. -fstack-protector -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -lpython2.7 -framework CoreFoundation -L/usr/local/lib -o vim        -lm -lncurses  -liconv -framework Cocoa  -L/usr/local/lib -llua -fstack-protector -L/usr/local/lib  -L/System/Library/Perl/5.16/darwin-thread-multi-2level/CORE -lperl -framework Python   -lruby.2.1.0 -lobjc -L/usr/local/Cellar/ruby/2.1.5/lib

But this is just because I've patched the build script, it was always linking against the system's python before.

@benmezger

This comment has been minimized.

benmezger commented Jan 31, 2015

@oblitum Do you still have that patch? I checked my compiled vim with otool;

vim:
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
    /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
    /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 20.0.0)
    /System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.5)
    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.2.0.0.dylib (compatibility version 2.0.0, current version 2.0.0)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1265.21.0)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 855.17.0)
    /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 59.0.0)
    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1056.17.0)
@oblitum

This comment has been minimized.

Contributor

oblitum commented Jan 31, 2015

@ephexeve the patch is simple, do a grep in the codebase using the information I give in the vim issue, and make the logic check correctly that you have a current python that's greater than 2.3. You may swap < for >=.

@oblitum

This comment has been minimized.

Contributor

oblitum commented Jan 31, 2015

@ephexeve This is what otool gives here:

❯❯❯ otool -L `which vim`                                                                                                       ✭ ✱
/opt/local/bin/vim:
        /usr/local/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.0)
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 855.17.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
        /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
        /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
        /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 20.0.0)
        /usr/local/lib/liblua.5.2.dylib (compatibility version 5.2.0, current version 5.2.3)
        /System/Library/Perl/5.16/darwin-thread-multi-2level/CORE/libperl.dylib (compatibility version 5.16.0, current version 5.16.2)
        /System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.5)
        /usr/local/lib/libruby.2.1.0.dylib (compatibility version 2.1.0, current version 2.1.0)
        /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
        /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1265.21.0)
        /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 59.0.0)
        /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1056.16.0)

notice there are two Pythons in my list... this is because the vim build is just messed up for OS X. I've applied that patch, but also when building I've set --with-python-config-dir, so that the given python gets priority over that one I don't care about....

CC=clang ./configure --prefix=/opt/local --with-features=huge --enable-luainterp --with-lua-prefix=/usr/local --enable-rubyinterp --enable-pythoninterp --with-python-config-dir=/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7 --enable-perlinterp --with-compiledby=francisco@oblita.com
@benmezger

This comment has been minimized.

benmezger commented Feb 1, 2015

Fixed it. Works fine now. Thanks for the help @oblitum.

@oblitum

This comment has been minimized.

Contributor

oblitum commented Feb 1, 2015

@ephexeve ok. glad to help.

@oblitum

This comment has been minimized.

Contributor

oblitum commented Mar 22, 2015

The fix I mention (for building upstream vim from sources) is not working anymore, build now links to system's python despite the settings I mention.

@oblitum

This comment has been minimized.

Contributor

oblitum commented Mar 22, 2015

I've removed --with-python-config-dir from the configure line, it's now working again (with the build patches I mention included).

@oblitum

This comment has been minimized.

Contributor

oblitum commented Apr 15, 2015

Recent VIM from tip got fixed regarding this.

@benmezger

This comment has been minimized.

benmezger commented Apr 15, 2015

@oblitum great to know. Thanks

@Remi-Coulom

This comment has been minimized.

Remi-Coulom commented May 1, 2015

If anybody else is trying to get ycm to work with macports, here is a simple way that worked for me. The main problem is that the default macports vim has no python support. Just install vim with that option:

sudo port install vim +python27

And then the macports vim will support python, and is linked with the same python version used by YCM if you compiled it with the default install script:

./install.sh --clang-completer

There is the macports ticket that gave me the solution: https://trac.macports.org/ticket/32629

@matipan

This comment has been minimized.

matipan commented Jun 9, 2015

Hey there, i've been having the exact same problem. If you have vim-ruby plugin installed, then you need to apply this changes to the vim-ruby/autoload/rubycomplete.vim file.
The problem is that vim-ruby tries to call instance_methods function in any variable, according to it's type, so when you do some like this:

some_var = gets.chomp
some_var.(here is were it'll stop working)

vim-ruby will try to come up with a list of instance_metthods for a variable of vartype "gets". There is were it breaks. But if you do the changes that are in that pull request(they haven't merged it yet, but it's been over 6 months so i don't think they will) everything will work. Hope this fixes your issue!!

@yqrashawn

This comment has been minimized.

yqrashawn commented Jan 2, 2016

same question

otool -L 'vim' /usr/local/Cellar/macvim/7.4-88/MacVim.app/Contents/MacOS/Vim
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool: can't open file: vim (No such file or directory)
/usr/local/Cellar/macvim/7.4-88/MacVim.app/Contents/MacOS/Vim:
    /System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.10)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1256.14.0)
    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 22.0.0)
    /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 157.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
    /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
    /System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/libperl.dylib (compatibility version 5.18.0, current version 5.18.2)
    /Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.0)
    /System/Library/Frameworks/Tcl.framework/Versions/8.5/Tcl (compatibility version 8.5.0, current version 8.5.9)
    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.2.0.0.dylib (compatibility version 2.0.0, current version 2.0.0)
    /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1404.34.0)
    /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 728.6.0)
    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1256.1.0)
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)

any idea?

@StudyForbidComment

This comment has been minimized.

StudyForbidComment commented Jan 22, 2016

@oblitum What is 'configure line'? and could you tell me where I should input the sentence 'CC=clang ./configure --prefix=/opt/local --with-features=huge --enable-luainterp --with-lua-prefix=/usr/local --enable-rubyinterp --enable-pythoninterp --with-python-config-dir=/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7 --enable-perlinterp --with-compiledby=francisco@oblita.com' ? Thanks

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