Skip to content
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

Getting "Vim: Caught deadly signal ABRT" after install. #8

Closed
utkarshkukreti opened this issue Feb 3, 2013 · 79 comments
Closed

Getting "Vim: Caught deadly signal ABRT" after install. #8

utkarshkukreti opened this issue Feb 3, 2013 · 79 comments

Comments

@utkarshkukreti
Copy link

I'm on OSX 10.8.2.

Steps I followed:

cd ~/.vim/bundle
git clone https://github.com/Valloric/YouCompleteMe.git
mkdir ~/dev/ycm_build
cd ~/dev/ycm_build
cmake -G "Unix Makefiles" . ~/.vim/bundle/YouCompleteMe/cpp

Got this output.

Now when I start vim, I get this:

➜  ycm_build  vim
Vim: Caught deadly signal ABRT
Vim: Finished.
[1]    10720 abort      vim

 ➜  ycm_build  vim
Vim: Caught deadly signal ABRT
Vim: Finished.
[1]    10740 abort      vim
vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jan 21 2013 00:59:00)
MacOS X (unix) version
Included patches: 1-772

If you need any more info, let me know. :)

@Valloric
Copy link
Member

Valloric commented Feb 3, 2013

Are you using the MacPorts version of Vim? If so, you're gonna have a bad time. :)

Seriously though, I've heard that getting YCM working with MacPorts Vim is tricky because YCM will link in the system version of Python whereas the MacPorts Vim links in the MacPorts Python. Segfaults ensue.

A co-worker got it working and sent me the instructions, but I don't have them near me. I'll update this issue and the README when I do.

I recommend MacVim. MacVim.app has a normal Vim binary inside the package which you can just call if you want the console Vim experience.

@Valloric
Copy link
Member

Valloric commented Feb 3, 2013

But while we're at it, delete everything in your build directory and paste me the output of your cmake call.

@utkarshkukreti
Copy link
Author

I'm not using MacPorts, I installed the HEAD version (as of Jan 2013) of vim using Homebrew [more info].

Here's the cmake output.

@Valloric
Copy link
Member

Valloric commented Feb 3, 2013

Hm, most interesting...

Please paste me the full output of vim --version.

@utkarshkukreti
Copy link
Author

vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jan 21 2013 00:59:00)
MacOS X (unix) version
Included patches: 1-772
Compiled by utkarsh@Utkarshs-MacBook-Air.local
Huge 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_sgr -mouse_sysmouse 
+mouse_urxvt +mouse_xterm +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
 -xterm_clipboard -xterm_save 
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: /usr/bin/clang -c -I. -Iproto -DHAVE_CONFIG_H   -F/usr/local/Frameworks -DMACOS_X_UNIX -no-cpp-precomp  -Os -w -pipe -march=native -Qunused-arguments -mmacosx-version-min=10.8 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: /usr/bin/clang   -L. -L/usr/local/lib -L/Users/utkarsh/.rvm/usr/lib  -L/usr/local/lib -F/usr/local/Frameworks -o vim       -lm  -lncurses -liconv -framework Cocoa     -framework Python   -lruby.1.9.1 -lobjc -L/Users/utkarsh/.rvm/rubies/ruby-1.9.3-p327/lib   

@Valloric
Copy link
Member

Valloric commented Feb 3, 2013

I'm officially stumped. Everything looks fine...

Could you download the latest MacVim and try that out? Just so that we rule out some things. If it works with MacVim, then the problem is in the way brew configured and compiled your vim binary.

@utkarshkukreti
Copy link
Author

Was just doing that. Will report in in a few minutes.

@utkarshkukreti
Copy link
Author

I get this error, I'm not sure which mapping it's referring to, but the plugin seems to be working fine.

E227: mapping already exists for <80><fc>^D

I guess the problem is with brew's vim compilation config?

@Valloric
Copy link
Member

Valloric commented Feb 3, 2013

Yeah, that error is telling you that YCM failed to create one of its key mappings, and by the looks of it it's <leader>d. I'm guessing you already have something mapped to it. See the Options section in the docs about changing that mapping to something else and the error will go away.

Brew seems to be screwing up something with vim's compilation, yes. I don't know what.

Again, I recommend MacVim.

@utkarshkukreti
Copy link
Author

Didn't know MacVim shipped with a console version! /Applications/MacVim.app/Contents/MacOS/Vim seems to be working well.

Thank you. :)

@Valloric
Copy link
Member

Valloric commented Feb 3, 2013

Yeah, MacVim actually runs a full, normal instance of Vim in the background that the GUI talks to. It's actually a pretty clever design that makes it very easy for MacVim to keep track of upstream Vim development.

@utkarshkukreti
Copy link
Author

I little off-topic, but I couldn't find this in the README (Maybe I didn't read it properly), how would I go about creating some simple completion modifications for other post types? Say, just add a few completion words by default for a specific file type?

@Valloric
Copy link
Member

Valloric commented Feb 3, 2013

That would be non-trivial, but not too difficult to do. Take a look at
how the two current completers use the completer.py API. You'd have to
write your own completer though.

On Sat, Feb 2, 2013 at 10:37 PM, Utkarsh Kukreti
notifications@github.comwrote:

I little off-topic, but I couldn't find this in the README (Maybe I didn't
read it properly), how would I go about creating some simple completion
modifications for other post types? Say, just add a few completion words by
default for a specific file type?


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-13043211.

@lxyu
Copy link

lxyu commented Feb 6, 2013

The workaround in #18 works in here too.

DYLD_FORCE_FLAT_NAMESPACE=1 DYLD_INSERT_LIBRARIES=/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib vim

And vim will start fine.

But any better solutions?

@lxyu
Copy link

lxyu commented Feb 17, 2013

Actually a single DYLD_FORCE_FLAT_NAMESPACE=1 will make things work.


I have updated the newest version of the plugin but it's still broken. Any idea?

@smgt
Copy link

smgt commented Feb 20, 2013

I have the same problem, I get Fatal Python error: PyThreadState_Get: no current thread. Works with DYLD_FORCE_FLAT_NAMESPACE=1.

@pencilcheck
Copy link

Same, I wonder if there is a way to fix install.sh to include this flag so we don't have to pass that every time we want to open Vim?

@luciferous
Copy link

Similar issue as the OP after update.

$ vim
Vim: Caught deadly signal ABRT
Vim: Finished.
Abort trap: 6

This works:

$ DYLD_FORCE_FLAT_NAMESPACE=1 vim

@quanganhdo
Copy link

I got the same problem and need to to use DYLD_FORCE_FLAT_NAMESPACE=1 as the workaround. Any idea how to fix this for good?

@linhmtran168
Copy link

Mac OS X 10.8.3, binary MacVim and Homebrew python. Using the following command to change the linked framework for MacVim fixed the problem for me (see more here).

install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/Python MacVim

@neverpanic
Copy link

This ticket is quite old, but since it keeps getting referenced I thought I'd give some insight in how to use YCM with vim compiled from MacPorts (same probably applies to Homebrew). As previously noted in this ticket, building YCM against a different Python version than vim itself can cause problems.

We can switch the version of Python used by YCM in a few spots:

  • At load time using DYLD_INSERT_LIBRARIES. DYLD_FORCE_FLAT_NAMESPACE works at the same point in time. While those might work depending on your current configuration they rely on system Python and whatever custom Python you have to be binary compatible.
  • After building using install_name_tool to swap the Python library being referenced by the loadable module (or even worse, the MacVim binary). This will also only work, if the Python implementations being swapped are binary compatible.
  • At compile time using the -DPYTHON_LIBRARY and -DPYTHON_INCLUDE_DIR settings for cmake. This is advisable, because it will actually use the set of headers that will match the library that will later be used, rather than replacing the library later and hoping the headers will be compatible with the swapped library.

YCM actually tries hard to get this right using function python_finder in install.sh. This will, however, not work correctly, if your custom python-config tool is not in $PATH when installing YCM. For MacPorts, you should sudo port select --set python python27 (or whatever version you used to compile vim) to fulfill this requirement. If you want to restore your previous setting afterwards, check what it was using port select --list python (it's the one marked active).

@quanganhdo
Copy link

If you got Python installed using Homebrew, before doing YouCompleteMe installation, unlink it

brew unlink python

@ChrisBuchholz
Copy link

@quanganhdo: I can confirm that unlinking homebrew python before installation and then linking again afterwards works for me.

@juztin
Copy link

juztin commented May 25, 2015

@Tatsh

No dice...

/opt/local/... paths do occur very first in my PATH env.

Executing the below gives me the same result:

  • PythonLibs points to built-in 2.7.6
  • PythonInterp points to 2.7.10.
env PATH=/opt/local/libexec/gnubin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin EXTRA_CMAKE_ARGS='-DPYTHON_EXECUTABLE=/opt/local/bin/python' bash install.sh --clang-completer --gocode-completer

I was digging a bit in the source and it looks like the 2 above paths are not discovered via CMake

./third_party/ycmb/build.py

def CustomPythonCmakeArgs():                                                     
   # The CMake 'FindPythonLibs' Module does not work properly.                                                                                                         
   # So we are forced to do its job for it.                                       

   python_prefix = sh.python_config( '--prefix' ).strip()
...

EDIT

MacPorts, on one machine, did NOT create this symlink but did on another.
Also Vim only seemed to link to MacPorts Python when supplying a single Py variant
(If both +python27 and +python34 are supplied it links to the Apple Python)

I finally tried creating the symlink python-config in /opt/local/bin to point to /opt/local/bin/python27-config, as this didn't exist.
Now I got the opposite issue (just running ./install.sh):

  • PythonLibs points to built-in 2.7.10
  • PythonInterp points to 2.7.6.

With the above symlink AND the EXTRA_CMAKE_ARGS variable things ended up working.

% EXTRA_CMAKE_ARGS='-DPYTHON_EXECUTABLE=/opt/local/bin/python' bash install.sh --clang-completer --gocode-completer

@Tatsh thanks for helping me get this working =)

@olalonde
Copy link

brew unlink python fixed the problem here.

@daniel0076
Copy link

@neverpanic solution works for me
my vim version 7.4.729 installed by macports
use port select --set python python27 to select the right python version
and all works fine

@wangwenchao
Copy link

I met this today , I have the system default installed python 2.7.6 and brew installed python 2.7.10_2 , after install the Ycm for vim , I got this error messages , and I do the brew unlink Python , vim is back to work

@avivrosenberg
Copy link

Encountered this on OSX Yosemite (10.10), homebrew python 2.7.10_2, MacVim 7.4-769, cmake 3.1.3.
MacVim was compiled with the brewed python, but when compiling YCM the system python was used for some reason, as I'm sure was the problem for others here.

Fixed this by adding -DPYTHON_INCLUDE_DIR=$(python-config --prefix)/Headers to the cmake command used for generating YCM's Makefiles. The cmake output showed that this way it found the correct python libs. (Note that python-config is of course from the brewed python.)

I didn't see this exact solution here. I hope it helps someone.

@JadianZheng
Copy link

@neverpanic Thank you for your explication. I just change the /usr/bin before PATH and rebuild youcompleteme project, and anything goes well. Just Thank you.

@chellberg
Copy link

Experienced this error today, was also fixed by brew unlink python - thanks, @wangwenchao

@csuttles
Copy link

Also hit this issue, even though my install was working previously. Thanks all for the contributions, thorough explanations and workarounds. 👍

@DelightRun
Copy link

A quick solution, don't need to brew unlink python, and also available for Anaconda:

$ export PATH="/usr/bin:$PATH"
$ which python
/usr/bin/python
$ python installer.py --clang-completer

@csuttles
Copy link

^ didn't work for me. Actually broke my workaround too. :'(

@georgethebeatle
Copy link

Here is what I used to get:

$ vim
Vim: Caught deadly signal ABRT
Vim: Finished.
Abort trap: 6

Adding export DYLD_FORCE_FLAT_NAMESPACE=1 to ~/.bash_profile worked for me on OSX 10.11.1, but I had to update all of my plugins (using Vundle) and then recompile YCM (by running its install.sh).

Hope that helps.

@d0u9
Copy link

d0u9 commented Nov 23, 2015

I am also using OSX 10.11.1 and experienced same problem as @georgethebeatle. solution from @dimitardanailov saved me, the most important thing you should keep in mind is that after reinstall python with brew install python --framework, reinstall vim is obligatory.

@lanox
Copy link

lanox commented Dec 19, 2015

i have spend over a day trying to get this working, over it .

trungdq88 added a commit to trungdq88/YouCompleteMe that referenced this issue Dec 21, 2015
@trungdq88
Copy link

@neverpanic Thank you for clear explanation. I think it worth a notice on the Installation guide, I created a pull request for that #1846.

@Tatsh
Copy link

Tatsh commented Jan 20, 2016

@juztin Either you did not have PATH set with MacPorts or you did not use port select python python27 to get the symlink set up that you manually made. I was able to install on a clean (Yosemite) OS X machine with the latest MacPorts and all I did was install vim, python27, and cmake from MacPorts, clone this repository, and ran the cmake command I had as before.

@dalguji
Copy link

dalguji commented Jun 20, 2016

The following post resolved the issue for me, thanks to @d0u9.

http://www.d0u9.xyz/solution-to-getting-vim-caught-deadly-signal-abrt-after-install/

@hardboydu hardboydu mentioned this issue Jul 4, 2016
@Tatsh
Copy link

Tatsh commented Jul 12, 2016

Back at it again 6 months later. There is not a great solution for those using MacPorts right now as MacPorts team does not want to support UCS 4 (wide) builds of Python 2.7 (there are a lot of conflicting packages). This means you can get this to work with the following but there is no support from MacPorts team if Python acts weird for you otherwise or if dependencies break because you have +ucs4 for your Python build.

Use the following:

port install python27 +readline
port install vim +python27
./install.py --gocode-completer --clang-completer --tern-completer

The only way to fix this is to patch YCM to not look for a UCS-4 build of Python (which is actually what comes with OS X too).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests