Youcompleteme: The ycmd server SHUT DOWN (restart with ':YcmRestartServer'). Unexpected error......when open vim

Created on 26 Nov 2020  路  10Comments  路  Source: ycm-core/YouCompleteMe

Issue Prelude

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

  • [x] I have read and understood YCM's CONTRIBUTING document.
  • [x] I have read and understood YCM's CODE_OF_CONDUCT document.
  • [x] I have read and understood YCM's README, especially the
    Frequently Asked Questions section.
  • [x] I have searched YCM's issue tracker to find issues similar to the one I'm
    about to report and couldn't find an answer to my problem. (Example Google
    search.
    )
  • [x] If filing a bug report, I have included the output of vim --version.
  • [x] If filing a bug report, I have included the output of :YcmDebugInfo.
  • [x] If filing a bug report, I have attached the contents of the logfiles using
    the :YcmToggleLogs command.
  • [x] If filing a bug report, I have included which OS (including specific OS
    version) I am using.
  • [x] If filing a bug report, I have included a minimal test case that reproduces
    my issue, using vim -Nu /path/to/YCM/vimrc_ycm_minimal, including what I
    expected to happen and what actually happened.
  • [x] If filing a installation failure report, I have included the entire output
    of install.py (or cmake/make/ninja) including its invocation
  • [x] I understand this is an open-source project staffed by volunteers and
    that any help I receive is a selfless, heartfelt _gift_ of their free time. I
    know I am not entitled to anything and will be polite and courteous.
  • [x] I understand my issue may be closed if it becomes obvious I didn't
    actually perform all of these steps.

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

Provide a clear description of the problem, including the following key
questions:

After installing YCM successfully, when entering vim, the Ycmd server shut down, as shown

image

And the err log shows:

  Traceback (most recent call last):
  4   File "/mnt/lun1/home/htliu/soft/k-vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/utils.py", line 498, in ImportAndCheckCore
  3     ycm_core = ImportCore()
  2   File "/mnt/lun1/home/htliu/soft/k-vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/utils.py", line 489, in ImportCore
  1     import ycm_core as ycm_core
7   ImportError: /mnt/lun1/home/htliu/soft/k-vim/bundle/YouCompleteMe/third_party/ycmd/ycm_core.so: undefined symbol: _ZNKSt10filesystem7__cxx114path12has_filenameEv

Some install snapshots :

image

image

image

  • What did you do?

Include steps to reproduce here.

  1. vim -Nu /path/to/YCM/ycm_vimrc_minimal
  2. :edit test.py
  3. Enter insert mode and type .....

Include description of a minimal test case, including any actual code required
to reproduce the issue.

If you made changes to vimrc_ycm_minimal, pase them here:

<contents of ycm_vimrc_minimal>
  • What did you expect to happen?

Include description of the expected behaviour.

  • What actually happened?

Include description of the observed behaviour, including actual output,
screenshots, etc.

Diagnostic data

Output of vim --version

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Oct 24 2020 16:26:37)
Included patches: 1-1897
Modified by [email protected]
Compiled by [email protected]
Huge version without GUI.  Features included (+) or not (-):
+acl               -farsi             +mouse_sgr         +tag_binary
+arabic            +file_in_path      -mouse_sysmouse    -tag_old_static
+autocmd           +find_in_path      +mouse_urxvt       -tag_any_white
+autochdir         +float             +mouse_xterm       -tcl
-autoservername    +folding           +multi_byte        +termguicolors
-balloon_eval      -footer            +multi_lang        +terminal
+balloon_eval_term +fork()            -mzscheme          +terminfo
-browse            +gettext           +netbeans_intg     +termresponse
++builtin_terms    -hangul_input      +num64             +textobjects
+byte_offset       +iconv             +packages          +textprop
+channel           +insert_expand     +path_extra        +timers
+cindent           +ipv6              -perl              +title
-clientserver      +job               +persistent_undo   -toolbar
-clipboard         +jumplist          +popupwin          +user_commands
+cmdline_compl     +keymap            +postscript        +vartabs
+cmdline_hist      +lambda            +printer           +vertsplit
+cmdline_info      +langmap           +profile           +virtualedit
+comments          +libcall           -python            +visual
+conceal           +linebreak         +python3           +visualextra
+cryptv            +lispindent        +quickfix          +viminfo
+cscope            +listcmds          +reltime           +vreplace
+cursorbind        +localmap          +rightleft         +wildignore
+cursorshape       -lua               -ruby              +wildmenu
+dialog_con        +menu              +scrollbind        +windows
+diff              +mksession         +signs             +writebackup
+digraphs          +modify_fname      +smartindent       -X11
-dnd               +mouse             +sound             -xfontset
-ebcdic            -mouseshape        +spell             -xim
+emacs_tags        +mouse_dec         +startuptime       -xpm
+eval              +mouse_gpm         +statusline        -xsmp
+ex_extra          -mouse_jsbterm     -sun_workshop      -xterm_clipboard
+extra_search      +mouse_netterm     +syntax            -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -Wdate-time  -g -O2 -fdebug-prefix-map=/build/vim-KZNIhZ/vim-8.2.1897=. -fstack-protector-strong -Wformat -Werror=format-security -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim        -lm -ltinfo  -lselinux  -lcanberra -lacl -lattr -lgpm -ldl     -L/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu -lpython3.6m -lpthread -ldl -lutil -lm

Output of YcmDebugInfo

Printing YouCompleteMe debug information...
-- Resolve completions: Never
-- Client logfile: /tmp/ycm_i4uoaqmt.log
-- Server errored, no debug info from server
-- Server running at: http://127.0.0.1:47463
-- Server process ID: 4527
-- Server logfiles:
--   /tmp/ycmd_47463_stdout_zmabn8_y.log
--   /tmp/ycmd_47463_stderr_9x0lb3h1.log

Output of YcmDiags

Paste output here

Output of git rev-parse HEAD in YouCompleteMe installation directory


Contents of YCM, ycmd and completion engine logfiles

Reproduce the issue with vim -Nu /path/to/YCM/vimrc_ycm_minimal, which
enabled debug logging and other useful diagnostics. Include a link to a
gist containing all of the log files listed by :YcmToggleLogs.

OS version, distribution, etc.

Include system information here.

Ubuntu 18.04 Server

Output of build/install commands

Include link to a gist containing the invocation and entire output of
install.py if reporting an installation issue.

Most helpful comment

my guess is that because you used a non-system-defualt compiler, it's expecting a different standard library at runtime

All 10 comments

You'll have to post the entire output of the install script. Also, this will be easier to troubleshoot on gitter instead.

Thanks for your advice, my install script is:

CXX=/usr/bin/gcc-8 ./install.py --clang-completer

I asked for the output of that, not just the invocation.

my guess is that because you used a non-system-defualt compiler, it's expecting a different standard library at runtime

The whole output is in https://paste.ubuntu.com/p/q5xfFZfYGp/

@puremourning Thanks for your reply. Yeah, since the default-system gcc version is 7.5.0, which could not support C++17, hence I have to install gcc8, but I would not to replace the default gcc7.
Maybe I can user update-alternatives to have a try.

Immediately, I see a few problems:

  1. You didn't override the C compiler, so cmake is still picking up gcc 7.5.0
  2. "Unknown compiler - not passing -lstdc++fs"

That second one is going to be a problem.

https://github.com/bstaletic/ycmd/blob/cxx17/cpp/ycm/CMakeLists.txt#L317-L345

Can you compile this code?

#include <filesystem>
int main( int argc, char ** argv ) {
  std::filesystem::path p( argv[ 0 ] );
  return p.string().length();
}

Note that gcc 8 need -lstdc++fs flag to correctly compile the above.

Hi, it indeed the compiler issues, I have changed the system-default-gcc into 8.x, and re-compile YCM, the problem has been solved.
Thanks!

@puremourning Maybe we should make "Unknown compiler" warning a hard error. Thoughts?

@ShomyLiu I almost forgot. Check out --clangd-completer - it has more features and is faster. Details are in the readme.

Nice, thanks, I would install again to have a try.

Was this page helpful?
0 / 5 - 0 ratings