tweekmonster / deoplete-clang2

MIT License
90 stars 17 forks source link

OSError: EOF #30

Closed x1314aq closed 3 years ago

x1314aq commented 6 years ago

OS: ubuntu 16.04; using neovim-0.2.3, clang: 5.0; After typing two chars, the error occurs.

[deoplete] Traceback (most recent call last):                                                                                               
  File "/home/x1314aq/.cache/vimfiles/repos/github.com/Shougo/deoplete.nvim/rplugin/python3/deoplete/child.py", line 232, in _gather_results                                 
    ctx['candidates'] = source.gather_candidates(ctx)                                                                                                                        
  File "/home/x1314aq/.cache/vimfiles/.cache/init.vim/.dein/rplugin/python3/deoplete/sources/deoplete_clang2.py", line 637, in gather_candidates                             
    buf = self.nvim.current.buffer                                                                                                                                           
  File "/usr/local/lib/python3.5/dist-packages/neovim/api/nvim.py", line 436, in buffer                                                                                      
    return self._session.request('nvim_get_current_buf')                                                                                                                     
  File "/usr/local/lib/python3.5/dist-packages/neovim/api/nvim.py", line 140, in request                                                                                     
    res = self._session.request(name, *args, **kwargs)                                                                                                                       
  File "/usr/local/lib/python3.5/dist-packages/neovim/msgpack_rpc/session.py", line 94, in request                                                                           
    raise IOError('EOF')                                                                                                                                                     
OSError: EOF                                                                                                                                                                 
Errors from: clang2.  Use :messages / see above for error details.
SuperBo commented 6 years ago

I also get some similar error. OS: OSX 10.13.4 neovim: 0.2.2 This error appears as soon as I switched to insert mode.

[deoplete] Traceback (most recent call last):
  File "/Users/superbo/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 468, in _on_event
    source.on_event(context)
  File "/Users/superbo/.local/share/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/source/file.py", line 35, in on_event
    self.vim.options['isfname'])
  File "/usr/local/lib/python3.6/site-packages/neovim/api/nvim.py", line 254, in call
    return self.request('nvim_call_function', name, args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/neovim/api/nvim.py", line 140, in request
    res = self._session.request(name, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/neovim/msgpack_rpc/session.py", line 94, in request
    raise IOError('EOF')
OSError: EOF
Exception during file.on_event for event 'InsertEnter': EOF.  Use :messages / see above for error details.
Synray commented 6 years ago

I got an error like this as well. OS: Arch neovim 0.2.3 most recent deoplete{-clang2}

[deoplete] Traceback (most recent call last):                                                                                                                                                                                                                                                          
  File ".config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 237, in _gather_results                                                                                                                                                                               
    ctx['candidates'] = source.gather_candidates(ctx)                                                                                                                                                                                                                                                  
  File ".config/nvim/plugged/deoplete-clang2/rplugin/python3/deoplete/sources/deoplete_clang2.py", line 638, in gather_candidates                                                                                                                                                         
    src = buf[:]                                                                                                                                                                                                                                                                                       
  File ".local/lib/python3.6/site-packages/neovim/api/buffer.py", line 48, in __getitem__                                                                                                                                                                                                 
    return self.request('nvim_buf_get_lines', start, end, False)                                                                                                                                                                                                                                       
  File ".local/lib/python3.6/site-packages/neovim/api/common.py", line 44, in request                                                                                                                                                                                                     
    return self._session.request(name, self, *args, **kwargs)                                                                                                                                                                                                                                          
  File ".local/lib/python3.6/site-packages/neovim/api/nvim.py", line 140, in request                                                                                                                                                                                                      
    res = self._session.request(name, *args, **kwargs)                                                                                                                                                                                                                                                 
  File ".local/lib/python3.6/site-packages/neovim/msgpack_rpc/session.py", line 94, in request                                                                                                                                                                                            
    raise IOError('EOF')                                                                                                                                                                                                                                                                               
OSError: EOF                                                                                                                                                                                                                                                                                           
Errors from: clang2.  Use :messages / see above for error details.                                                                                                                                                                                                                                     
[deoplete] Traceback (most recent call last):                                                                                                                                                                                                                                                          
  File ".config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 237, in _gather_results                                                                                                                                                                               
    ctx['candidates'] = source.gather_candidates(ctx)                                                                                                                                                                                                                                                  
  File ".config/nvim/plugged/deoplete-clang2/rplugin/python3/deoplete/sources/deoplete_clang2.py", line 638, in gather_candidates                                                                                                                                                         
    src = buf[:]                                                                                                                                                                                                                                                                                       
  File ".local/lib/python3.6/site-packages/neovim/api/buffer.py", line 48, in __getitem__                                                                                                                                                                                                 
    return self.request('nvim_buf_get_lines', start, end, False)                                                                                                                                                                                                                                       
  File ".local/lib/python3.6/site-packages/neovim/api/common.py", line 44, in request                                                                                                                                                                                                     
    return self._session.request(name, self, *args, **kwargs)                                                                                                                                                                                                                                          
  File ".local/lib/python3.6/site-packages/neovim/api/nvim.py", line 140, in request                                                                                                                                                                                                      
    res = self._session.request(name, *args, **kwargs)                                                                                                                                                                                                                                                 
  File ".local/lib/python3.6/site-packages/neovim/msgpack_rpc/session.py", line 94, in request                                                                                                                                                                                            
    raise IOError('EOF')                                                                                                                                                                                                                                                                               
OSError: EOF                                                                                                                                                                                                                                                                                           
During handling of the above exception, another exception occurred:                                                                                                                                                                                                                                    
Traceback (most recent call last):                                                                                                                                                                                                                                                                     
  File ".config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/dp_main.py", line 52, in main                                                                                                                                                                                         
    child.main_loop(stdout)                                                                                                                                                                                                                                                                            
  File ".config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 69, in main_loop                                                                                                                                                                                      
    ret = self.main(name, args, queue_id)                                                                                                                                                                                                                                                              
  File ".config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 90, in main                                                                                                                                                                                           
    ret = self._merge_results(args[0], queue_id)                                                                                                                                                                                                                                                       
  File ".config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 155, in _merge_results                                                                                                                                                                                
    results = self._gather_results(context)                                                                                                                                                                                                                                                            
  File ".config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/child.py", line 268, in _gather_results                                                                                                                                                                               
    error_tb(self._vim, 'Errors from: %s' % source.name)                                                                                                                                                                                                                                               
  File ".config/nvim/plugged/deoplete.nvim/rplugin/python3/deoplete/util.py", line 122, in error_tb                                                                                                                                                                                       
    vim.err_write('[deoplete] %s\n' % '\n'.join(lines))                                                                                                                                                                                                                                                
  File ".local/lib/python3.6/site-packages/neovim/api/nvim.py", line 331, in err_write                                                                                                                                                                                                    
    return self.request('nvim_err_write', msg, **kwargs)                                                                                                                                                                                                                                               
  File ".local/lib/python3.6/site-packages/neovim/api/nvim.py", line 140, in request                                                                                                                                                                                                      
    res = self._session.request(name, *args, **kwargs)                                                                                                                                                                                                                                                 
  File ".local/lib/python3.6/site-packages/neovim/msgpack_rpc/session.py", line 94, in request                                                                                                                                                                                            
    raise IOError('EOF')                                                                                                                                                                                                                                                                               
OSError: EOF                                                                                                                                                                                                                                                                                           
Error in child.  Use :messages / see above for error details.                                                                                                                                                                                                                                          
Traceback (most recent call last):                                                                                                                                                                                                                                                                     
During handling of the above exception, another exception occurred:                                                                                                                                                                                                                                    
During handling of the above exception, another exception occurred: 
Shougo commented 6 years ago

https://github.com/SpaceVim/SpaceVim/issues/1588

Shougo commented 6 years ago

It seems occur neoinclude.vim + deoplete-clang2. I don't know why though.

Shougo commented 6 years ago

I get the reason.

diff --git a/rplugin/python3/deoplete/sources/deoplete_clang2.py b/rplugin/python3/deoplete/sources/deoplete_clang2.py
index 56d60fc..a1c8c70 100644
--- a/rplugin/python3/deoplete/sources/deoplete_clang2.py
+++ b/rplugin/python3/deoplete/sources/deoplete_clang2.py
@@ -13,6 +13,7 @@ import subprocess

 from itertools import chain
 from urllib.request import urlopen
+from deoplete.util import getlines

 from .base import Base

@@ -154,9 +155,9 @@ class Source(Base):
             neomake_flags = set(cmd + flags)
             if self.last_neomake_flags ^ neomake_flags:
                 self.last_neomake_flags = neomake_flags
-                self.nvim.async_call(lambda n, m:
-                                     n.eval('clang2#set_neomake_cflags(%r)' % m),
-                                     self.nvim, cmd + flags)
+                # self.nvim.async_call(lambda n, m:
+                #                      n.eval('clang2#set_neomake_cflags(%r)' % m),
+                #                      self.nvim, cmd + flags)

     def get_complete_position(self, context):
         m = re.search(r'^\s*#(?:include|import)\s+["<]', context['input'])
@@ -635,7 +636,7 @@ class Source(Base):
             return self.scope_completions

         buf = self.nvim.current.buffer
-        src = buf[:]
+        src = getlines(self.nvim)
         max_lines = context['vars'].get(
             'deoplete#sources#clang#preproc_max_lines', 50)
         if max_lines:

nvim.async_call() + asyncio seems broken.

https://github.com/SpaceVim/SpaceVim/issues/1588#issuecomment-381320396