ycm-core / YouCompleteMe

A code-completion engine for Vim
http://ycm-core.github.io/YouCompleteMe/
GNU General Public License v3.0
25.44k stars 2.8k forks source link

MacVim freezes with YouCompleteMe on Catalina - RESOLVED #3520

Closed MrMonk3y closed 4 years ago

MrMonk3y commented 4 years ago

Issue Prelude

Please complete these steps and check these boxes (by putting an x inside the brackets) before filing your issue:

Thank you for adhering to this process! It ensures your issue is resolved quickly and that neither your nor our time is needlessly wasted.

Issue Details

Starting VIM in Terminal or MACVIM on my Macbook Pro freezes it immediately when YouCompleteMe is installed.

Whenever I set up a new machine I install amix/vimrc. Then I put YouCompleteMe inside the my_plugin folder, install with ./install.py --clangd-completer and it works.

But this time everything freezes. The VIM process uses immediately 50% CPU usage. I went to gittr where I received a lot of help from @bstaletic. So far we have learned:

VIM not to freeze...

VIM freezes

Diagnostic data

Output of vim --version

VIM - Vi IMproved 8.1 (2018 May 18, compiled Oct 28 2019 11:33:50) macOS version Included patches: 1-2224 Compiled by travis@Traviss-Mac.local Huge version with MacVim GUI. Features included (+) or not (-): +acl +file_in_path +mouse_urxvt -tcl +arabic +find_in_path +mouse_xterm +termguicolors +autocmd +float +multi_byte +terminal +autochdir +folding +multi_lang +terminfo -autoservername -footer -mzscheme +termresponse +balloon_eval +fork() +netbeans_intg +textobjects +balloon_eval_term +fullscreen +num64 +textprop +browse -gettext +odbeditor +timers ++builtin_terms -hangul_input +packages +title +byte_offset +iconv +path_extra +toolbar +channel +insert_expand +perl/dyn +transparency +cindent +job +persistent_undo +user_commands +clientserver +jumplist +postscript +vartabs +clipboard +keymap +printer +vertsplit +cmdline_compl +lambda +profile +virtualedit +cmdline_hist +langmap +python/dyn +visual +cmdline_info +libcall +python3/dyn +visualextra +comments +linebreak +quickfix +viminfo +conceal +lispindent +reltime +vreplace +cryptv +listcmds +rightleft +wildignore +cscope +localmap +ruby/dyn +wildmenu +cursorbind +lua/dyn +scrollbind +windows +cursorshape +menu +signs +writebackup +dialog_con_gui +mksession +smartindent -X11 +diff +modify_fname -sound -xfontset +digraphs +mouse +spell +xim +dnd +mouseshape +startuptime -xpm -ebcdic +mouse_dec +statusline -xsmp +emacs_tags -mouse_gpm -sun_workshop -xterm_clipboard +eval -mouse_jsbterm +syntax -xterm_save +ex_extra +mouse_netterm +tag_binary +extra_search +mouse_sgr -tag_old_static -farsi -mouse_sysmouse -tag_any_white system vimrc file: "$VIM/vimrc" user vimrc file: "$HOME/.vimrc" 2nd user vimrc file: "~/.vim/vimrc" user exrc file: "$HOME/.exrc" system gvimrc file: "$VIM/gvimrc" user gvimrc file: "$HOME/.gvimrc" 2nd user gvimrc file: "~/.vim/gvimrc" defaults file: "$VIMRUNTIME/defaults.vim" system menu file: "$VIMRUNTIME/menu.vim" fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim" Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -DMACOS_X -DMACOS_X_DARWIN -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 Linking: clang -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/readline/lib -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/readline/lib -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon -lm -lncurses -liconv -framework AppKit -fstack-protector -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE

Output of YcmDebugInfo

-

Contents of YCM, ycmd and completion engine logfiles

stderr logs: DEBUG - No global extra conf, not calling method YcmCorePreload and stdout: serving on http://localhost:54407

OS version, distribution, etc.

MacOS Catalina 10.15

Output of build/install commands

-

halilim commented 4 years ago

I can confirm this with MacVim 8.1.2224 (160). Tried both the release and Homebrew Cask one.

andy-retailnext commented 4 years ago

I'm also getting an error with YouCompleteMe and the latest version of MacVim (8.1.2224). (I'm running this on Mojave.) It doesn't freeze for me, but on startup some error lines are printed out. I captured the first several lines below (the repeated things that vim prints before each piece of output have been removed):

Error detected while processing function 42_PollServerReady[7]..42_Pye Traceback (most recent call last): File "", line 1, in File "/Users/andy/.vim/bundle/YouCompleteMe/python/ycm/youcompleteme.py", line 244, in CheckIfServerIsReady 'ready', display_message = False ) File "/Users/andy/.vim/bundle/YouCompleteMe/python/ycm/client/base_request.py" , line 113, in GetDataFromHandler self.GetDataFromHandlerAsync( handler, timeout, payload ),

I don't know if that's helpful or not, and please tell me if there's a better way to get this output. After I hit ENTER a bunch of times to get through the error messages, MacVim crashes or shows the message "The ycmd server SHUT DOWN (restart with ':YcmRestartServer'). YCM core library not ...u need to compile YCM before using it." If I run that command, MacVim crashes.

MrMonk3y commented 4 years ago

I'm also getting an error with YouCompleteMe and the latest version of MacVim (8.1.2224). (I'm running this on Mojave.) It doesn't freeze for me, but on startup some error lines are printed out. I captured the first several lines below (the repeated things that vim prints before each piece of output have been removed):

Error detected while processing function 42_PollServerReady[7]..42_Pye Traceback (most recent call last): File "", line 1, in File "/Users/andy/.vim/bundle/YouCompleteMe/python/ycm/youcompleteme.py", line 244, in CheckIfServerIsReady 'ready', display_message = False ) File "/Users/andy/.vim/bundle/YouCompleteMe/python/ycm/client/base_request.py" , line 113, in GetDataFromHandler self.GetDataFromHandlerAsync( handler, timeout, payload ),

I don't know if that's helpful or not, and please tell me if there's a better way to get this output. After I hit ENTER a bunch of times to get through the error messages, MacVim crashes or shows the message "The ycmd server SHUT DOWN (restart with ':YcmRestartServer'). YCM core library not ...u need to compile YCM before using it." If I run that command, MacVim crashes.

Thats exactly something @bstaletic and I talked about. However, interesting I do not get this messages. Do you have MacVim with the usual python2.7 or have you build it with python3? The latter is something @bstaletic suspects it could change something (despite a logical reason). Did not have the time to test that.

andy-retailnext commented 4 years ago

The vim Python version is 2.7.10.

bstaletic commented 4 years ago

@andy-retailnext When posting errors, please don't truncate them.

The ycmd server SHUT DOWN (restart with ':YcmRestartServer'). YCM core library not ...u need to compile YCM before using it.

The full message looks like this. Read the docs and compile YCM, this is definitely a user error.

andy-retailnext commented 4 years ago

I think I may have mixed up a couple of different attempts to reinstall YouCompleteMe. I think I got the error about compiling one time when I installed the plug-in but neglected to run install.py. If I install the plug-in and run install.py, when I start MacVim, i get the errors that I included in my first comment.

slukits commented 4 years ago

Observing same behaviour (MacBook Pro, 10.15.1 Catalina, VIM - Vi IMproved 8.1 (2018 May 18, compiled Oct 28 2019 11:33:50) macOS version Included patches: 1-2224)

puremourning commented 4 years ago

Has anyone reported this to the macvim vendor? This is not a YCM issue, it’s almost certainly a python installation issue. One user resolved it by removing stuff from homebrew python’s site packages. Without any information about your python installation and vim build it’s almost impossible to help.

Finally, please do not post any more ‘me too’ replies unless you have further useful diagnostics to add to the discussion.

Per CONTRIBUTING.md unless we can repro in a vanilla system we can’t help and the issue tracker is not for tech support.

MrMonk3y commented 4 years ago

Observing same behaviour (MacBook Pro, 10.15.1 Catalina, VIM - Vi IMproved 8.1 (2018 May 18, compiled Oct 28 2019 11:33:50) macOS version Included patches: 1-2224)

@AUsernameWhichIsNotTaken compiled with python3 or 2?

slukits commented 4 years ago

On 30. Oct 2019, at 11:03, Sascha Jecklin notifications@github.com wrote:

Observing same behaviour (MacBook Pro, 10.15.1 Catalina, VIM - Vi IMproved 8.1 (2018 May 18, compiled Oct 28 2019 11:33:50) macOS version Included patches: 1-2224)

@AUsernameWhichIsNotTaken https://github.com/AUsernameWhichIsNotTaken compiled with python3 or 3?

+python/dyn +python3/dyn

VIM - Vi IMproved 8.1 (2018 May 18, compiled Oct 28 2019 11:33:50) macOS version Included patches: 1-2224 Compiled by travis@Traviss-Mac.local Huge version with MacVim GUI. Features included (+) or not (-): +acl +file_in_path +mouse_urxvt -tcl +arabic +find_in_path +mouse_xterm +termguicolors +autocmd +float +multi_byte +terminal +autochdir +folding +multi_lang +terminfo -autoservername -footer -mzscheme +termresponse +balloon_eval +fork() +netbeans_intg +textobjects +balloon_eval_term +fullscreen +num64 +textprop +browse -gettext +odbeditor +timers ++builtin_terms -hangul_input +packages +title +byte_offset +iconv +path_extra +toolbar +channel +insert_expand +perl/dyn +transparency +cindent +job +persistent_undo +user_commands +clientserver +jumplist +postscript +vartabs +clipboard +keymap +printer +vertsplit +cmdline_compl +lambda +profile +virtualedit +cmdline_hist +langmap +python/dyn +visual +cmdline_info +libcall +python3/dyn +visualextra +comments +linebreak +quickfix +viminfo +conceal +lispindent +reltime +vreplace +cryptv +listcmds +rightleft +wildignore +cscope +localmap +ruby/dyn +wildmenu +cursorbind +lua/dyn +scrollbind +windows +cursorshape +menu +signs +writebackup +dialog_con_gui +mksession +smartindent -X11 +diff +modify_fname -sound -xfontset +digraphs +mouse +spell +xim +dnd +mouseshape +startuptime -xpm -ebcdic +mouse_dec +statusline -xsmp +emacs_tags -mouse_gpm -sun_workshop -xterm_clipboard +eval -mouse_jsbterm +syntax -xterm_save +ex_extra +mouse_netterm +tag_binary +extra_search +mouse_sgr -tag_old_static -farsi -mouse_sysmouse -tag_any_white

BinaryMisfit commented 4 years ago

If your using the latest MacVim 160 Snapshot this is a known issue due to them trying to implement the changes required to meet Apple's notarary standards breaking python support.

Reference here: https://github.com/macvim-dev/macvim/issues/979. Related: https://github.com/macvim-dev/macvim/pull/980

MacVim 161 will fix this and will be out in the next day or 2.

ychin commented 4 years ago

Fixed in https://github.com/macvim-dev/macvim/releases/latest

bstaletic commented 4 years ago

@ychin Thanks for informing us. We can close this now.

 

For TabNine users, YCM maintainers have never and will never support TabNine, for more than just technical reasons. Besides, allow me to quote TabNine's README:

The Vim client for TabNine is adapted from YouCompleteMe. This client is an incompatible fork of YouCompleteMe, so please do not contact the YCM maintainers regarding any problems with it. Instead, create an issue in this repository.

BinaryMisfit commented 4 years ago

@ychin @bstaletic Tested with latest snapshot and confirm YCM is working again

MrMonk3y commented 4 years ago

tested, works!

shouldn't we close then this one too?

bstaletic commented 4 years ago

@MrMonk3y That repository has nothing to do with YCM. To be mild, I'll just say it's a proprietary fork that violates the spirit but not the license. To not prolong the discussion about TabNine, I'm going to lock the thread as I think I made my point of view about it very clear.

puremourning commented 4 years ago

Pinning this issue as it has clearly affected a number of users and the resolution is, thanks to @BinaryMisfit, to upgrade MacVim.