Shougo / deoplete.nvim

:stars: Dark powered asynchronous completion framework for neovim/Vim8
Other
5.94k stars 295 forks source link

deoplete causes the segv error when vim is exit #1114

Closed zhuzhzh closed 4 years ago

zhuzhzh commented 4 years ago

Warning: I will close the issue without the minimal init.vim and the reproduction instructions.

Problems summary

when vim exits, segv signal is catught. And ls output will be messy

$ vi
Vim: Caught deadly signal SEGV
Vim: Finished.
[1]    87924 segmentation fault  vim
$ ls
aet  collect    Desktop                      dw       ibeta  mmp    Pictures  study  Templates  workshop   xtor
                                                                                                                       app  customers  developmentstudio-workspace  indir  Music  Public    sv     tmp        Videos  xelserver  xtr
                                                                       bak  demo       Documents                    example  lib32  perl5  stratus   tcl    utility    xenc

Thru the multiple experiments, I confirmed the issue is caused by deoplete. And it's not due to the conflicts with other plugins.

Expected

Environment Information

Provide a minimal init.vim/vimrc with less than 50 lines (Required!)

" Your minimal init.vim/vimrc
Plug 'Shougo/deoplete.nvim'
let s:my_loading_deoplete = 1
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
if exists("s:my_loading_deoplete")
    let g:deoplete#enable_at_startup = 1
    let g:python3_host_prog='/home/harriszh/app/bin/python3'
endif

How to reproduce the problem from neovim/Vim startup (Required!)

vim :q

Generate a logfile if appropriate

Screenshot (if possible)

Upload the log file

(gdb) info threads
  9 Thread 83145  0x000000388a0dadf5 in _xstat () from /lib64/libc.so.6
* 8 Thread 83144  0x000000388a80e264 in __lll_lock_wait () from /lib64/libpthread.so.0
  7 Thread 83143  0x000000388a80e264 in __lll_lock_wait () from /lib64/libpthread.so.0
  6 Thread 83131  0x000000388a80e264 in __lll_lock_wait () from /lib64/libpthread.so.0
  5 Thread 83142  0x000000388a80e264 in __lll_lock_wait () from /lib64/libpthread.so.0
  4 Thread 0x2adfdd4a3700 (LWP 83127)  0x000000388a0df0d3 in poll () from /lib64/libc.so.6
  3 Thread 0x2adfe8200700 (LWP 83129)  0x000000388a80eb5c in recv () from /lib64/libpthread.so.0
  2 Thread 0x2adfdd6a4700 (LWP 83128)  0x000000388a0df0d3 in poll () from /lib64/libc.so.6
  1 Thread 0x2adfd4f05ba0 (LWP 83126)  0x000000388a032907 in kill () from /lib64/libc.so.6
(gdb) thread 9
[Switching to thread 9 (Thread 83145)]#0  0x000000388a0dadf5 in _xstat () from /lib64/libc.so.6

(gdb) bt
#0  0x000000388a0dadf5 in _xstat () from /lib64/libc.so.6
#1  0x0000000000623aeb in stat (file=<value optimized out>, forceit=0) at /usr/include/sys/stat.h:457
#2  write_viminfo (file=<value optimized out>, forceit=0) at viminfo.c:3167
#3  0x000000000067dfb7 in getout (exitval=1) at main.c:1636
#4  <signal handler called>
#5  0x000000388980b716 in _dl_relocate_object () from /lib64/ld-linux-x86-64.so.2
#6  0x0000003889812c4a in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
#7  0x000000388980e266 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#8  0x00000038898125aa in _dl_open () from /lib64/ld-linux-x86-64.so.2
#9  0x000000388a126b20 in do_dlopen () from /lib64/libc.so.6
#10 0x000000388980e266 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#11 0x000000388a126c77 in __libc_dlopen_mode () from /lib64/libc.so.6
#12 0x000000388a80fe1c in pthread_cancel_init () from /lib64/libpthread.so.0
#13 0x000000388a80ff7c in _Unwind_ForcedUnwind () from /lib64/libpthread.so.0
#14 0x000000388a80de90 in __pthread_unwind () from /lib64/libpthread.so.0
#15 0x000000388a8080a5 in pthread_exit () from /lib64/libpthread.so.0
#16 0x00002adfd4752764 in PyThread_exit_thread () at Python/thread_pthread.h:357
#17 0x00002adfd4782999 in t_bootstrap (boot_raw=0x2adfdd273e10) at ./Modules/_threadmodule.c:1021
#18 0x00002adfd47526c7 in pythread_wrapper (arg=<value optimized out>) at Python/thread_pthread.h:232
#19 0x000000388a8079d1 in start_thread () from /lib64/libpthread.so.0
#20 0x000000388a0e88fd in clone () from /lib64/libc.so.6
Shougo commented 4 years ago

Please test the latest version of Vim. Because the latest Vim includes Python interface changes.

Shougo commented 4 years ago

I have tested it, but I don't reproduce the problem.

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jul  8 2020 09:14:01)
Included patches: 1-1153
Compiled by Shougo
Huge version with GTK3 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_gui    +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_interact
+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"
  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: "/usr/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/fribidi -I/usr/include/uuid -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/at-spi-2.0 -pthread    -g -O2 -D_REENTRANT  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L. -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic  -L/usr/local/lib -Wl,--as-needed -o vim   -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0  -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lelf   -lcanberra  -lacl -lattr -lgpm -ldl  -L/usr/lib -lluajit-5.1   -L/usr/lib/python3.8/config-3.8-x86_64-linux-gnu -lpython3.8 -lcrypt -lpthread -ldl -lutil -lm -lm  -lruby -lm
set rtp+=~/work/deoplete.nvim/
set rtp+=~/work/nvim-yarp
set rtp+=~/work/vim-hug-neovim-rpc
let g:deoplete#enable_at_startup = 1

set completeopt+=noinsert

vimrc is here.

Shougo commented 4 years ago
How to reproduce the problem from neovim/Vim startup (Required!)

vim
:q

This instruction is correct? Why other people does not complain about the problem??

Shougo commented 4 years ago

And it seems Vim's problem. Both deoplete and nvim-yarp cannot crash Vim.

You should report the problem in Vim issue. And you can bisect Vim's commit.

Shougo commented 4 years ago

And please test it in other environment. It should be reproduce-able in every environment.

zhuzhzh commented 4 years ago

@Shougo I am doing the experiments. baiscally, I unintall all the packages I installed. Then install them one by one. After installing libffi, openssl, python3.8.3, vim8.2.1149, vim doesn't crash. so it should be the conflict issue of vim and other library. deoplete by happen uses this library. I will close this issue.

Thanks!

Shougo commented 4 years ago

OK.