Shougo / deoplete.nvim

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

Segfault on vim exit #624

Closed rtucek closed 6 years ago

rtucek commented 6 years ago

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

Problems summary

I switch often between vim and neovim.

If using vim having the plugin loaded, it crashes on normal exiting (:q) with a segfault:

Output:

Vim: Caught deadly signal SEGV
Vim: Finished
Segmentation fault (core dumped)

It breaks vim badly on exit (causing character bleed if scrolled after the crash, this can be fixed by the reset command as described here).

ONLY vim is affected.

I started, commenting out plugins and nailed it down to Plug 'Shougo/deoplete.nvim'. If the plugin is commented out, vim won't crash on exit anymore. My .vimrc is available here - see line 24.

Expected

...no segfault on exit

Environment Information

$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 17.10 Release: 17.10 Codename: artful


 * neovim/Vim version:

8.0.550

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

```vim
set nocompatible

call plug#begin('~/.vim/bundle')
    Plug 'Shougo/deoplete.nvim' " <-- comment out this line and no segfault
    Plug 'roxma/nvim-yarp'
    Plug 'roxma/vim-hug-neovim-rpc'
call plug#end()

let g:deoplete#enable_at_startup = 1

The reproduce ways from neovim/Vim starting (Required!)

Just exit with :q - again, vim only

Generate a logfile if appropriate

n/a

Screen shot (if possible)

here

Upload the log file

coredump

Shougo commented 6 years ago

The crash is not deoplete problem. Your Vim version is too old. Please check it in the latest Vim version.

Closing.

rtucek commented 6 years ago

This is Ubuntu's default version for release 17.10... upgrading means either self-compiling vim or switching to a different PPA. I bet the majority of users are sticking with the distro's default version, so closing the issue with just a "please upgrade" notice isn't really sufficient.

Anyway - here is the happy end: At home, I've the same setup but wasn't able to reproduce the error. I spent I few hours, trying to figure out what might be different (python version, other local libs, etc...), but couldn't find any possible reasons for the issue.

Today at the office, I updated the plugin and got some of the most recent patches and now everything works fine! It looks like you fixed it somewhere between 865747e...da4fd85 by accident(?). Unfortunately I'm not a python developer, but if you're curious I could try to bisect the fix if you want.

PS: thank you for the great plugin!

Shougo commented 6 years ago

Ah, I have many changed on master. So it is different version.

This is Ubuntu's default version for release 17.10... upgrading means either self-compiling vim or switching to a different PPA. I bet the majority of users are sticking with the distro's default version, so closing the issue with just a "please upgrade" notice isn't really sufficient.

Because SEGV is Vim's bug. Vim plugins cannot fix SEGV.

rtucek commented 6 years ago

Because SEGV is Vim's bug. Vim plugins cannot fix SEGV.

Yeah, I totally agree on that. Vim is accessing memory it's not supposed to do - clearly a Vim bug and should be fixed there - PERIOD!

...HOWEVER (and this is why I'm here), this bug was triggered by the plugin under normal circumstances with minimal configuration. This shouldn't happen - in particular, given the fact it's THAT version that is shipped by default by Ubuntu's most recent distro release. Even if the memory bug is already fixed in a more recent versions of vim, the potential of having a huge userbase, affected by the bug, might be frightening high.

However, I must also admit I was completely overestimating the entire issue, as it turns out I'm the only one who was running into the SEGV bug... I couldn't even reproduce it with the same hardware, with the same setup, but on a different machine...

rjpgt commented 6 years ago

Segfault on Vim8 for me too. Same configuration. But I get a Segfault only on a :wq . If I do a :w followed by a :q then it doesn't crash. The problem is definitely caused by the deoplete plugin. Because if I disable it there is no crash.

Shougo commented 6 years ago

Please upload GDB stacktrace. I cannot reproduce the problem.

Shougo commented 6 years ago

@rjpgt And what is your Vim version? I think your Vim8 version is very old. So I cannot fix the problem. You should build the latest version manually.

Workaround: You can disable deoplete multiprocess feature. let g:deoplete#num_processes = 1

rjpgt commented 6 years ago

My Vim8 version was 8.0.550. After upgrading to Vim 8.0.1525 the problem is gone. Thank you.

Shougo commented 6 years ago

Oh...

zhuzhzh commented 4 years ago

I hit the same issue with vim 8.2.1149