问题描述
Vim: Caught deadly signal ABRT
Vim: Finished.
Abort trap: 6
问题分析
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 forcmake
. 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).
解决方法
If you got Python installed using Homebrew, before doing YouCompleteMe installation, unlink it
brew unlink python
然后再 build 一遍。
更新
2016年07月21日
在重新安装过 YCMD 之后重现这个问题,解决方法就是和上面的一样,不过之前没说清楚,正确是应该是:
brew unlink python
然后重新 build 一遍 YCMD,而不是 VIM!!!