-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vim crashes after ycmd #593
Comments
Vim Version:
Ubuntu 13.04, Clang version 3.4 (trunk 190255). |
I'm going to have to take a closer look at this, but at first glance, I'd put my money on a Vim bug. The ycmd server cannot crash your Vim because it runs inside a separate process; the ycm client code running inside Vim gets JSON from ycmd. This is then transformed into data that is sent to Vim for display as a completion menu. The fact that the crash happens as you select an item in the completion menu very strongly suggests that this is a Vim bug. No YCM code runs when you tab through the menu, only Vim-internal code. Try updating to the latest Vim version and see if you can still repro this. |
@Valloric I know the separation between client and server, the question is that I wasn't suffering this before, and haven't updated Vim, so I thought it could be something to do with the client, more specifically filling the menu with data Vim doesn't like. |
I'll try a Vim update to see whether it gets fixed. |
It might be caused by filling the menu with data Vim doesn't like, but that would still be a bug in Vim because Vim shouldn't crash in such a situation. That being said, YCM would then try to work around that Vim bug. |
Just updated to tip of trunk, same problem:
|
I had switched back to master and rebuild, no problems, then switched back to ycmd and rebuild, the issue is triggered. |
on purpose, I'd like to comment on a kind of feature request, anytime Vim crashes one gets a leaked server instance, I then must go to system monitor and terminate the correspoding instance to the crashed Vim instance. It would be nice to have some kind of seppuku from the server part when a Vim client dies. |
This is actually already on my internal TODO list. There'll be a sort of suicide timer that will kill the server when no request has been received for some (configurable) time. |
I think I hit the target, the other stuff that shows up with the "tab tab tab tab" is the preview window and its contents, so to make a simple test I've executed |
BTW thanks for continuing to test out ycmd and reporting issues. You've been a big help! |
np :-) |
I can't repro this. Here's my test file: #include <boost/bimap.hpp>
int main() {
// input goes below here
} Below the comment, I type Here's my extra conf for testing: import os
flags = [
'-std=c++11',
'-x',
'c++',
'-isystem',
'../Downloads/boost_1_54_0',
]
def DirectoryOfThisScript():
return os.path.dirname( os.path.abspath( __file__ ) )
def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
if not working_directory:
return list( flags )
new_flags = []
make_next_absolute = False
path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
for flag in flags:
new_flag = flag
if make_next_absolute:
make_next_absolute = False
if not flag.startswith( '/' ):
new_flag = os.path.join( working_directory, flag )
for path_flag in path_flags:
if flag == path_flag:
make_next_absolute = True
break
if flag.startswith( path_flag ):
path = flag[ len( path_flag ): ]
new_flag = path_flag + os.path.join( working_directory, path )
break
if new_flag:
new_flags.append( new_flag )
return new_flags
def FlagsForFile( filename ):
relative_to = DirectoryOfThisScript()
final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
return {
'flags': final_flags,
'do_cache': True
} As you can see, I have I have noticed you have |
I'm using boost from svn repo (compiled with clang & libc++), the last commit is:
My Vim is:
I'm using Ubuntu 13.04. My import os
import ycm_core
from clang_helpers import PrepareClangFlags
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-x',
'c++',
'-Wall',
'-Wextra',
'-fPIE',
'-D_REENTRANT',
'-std=c++1y',
'-stdlib=libc++',
'-ftemplate-depth=8192',
'-fconstexpr-depth=8192',
'-lcxxrt',
'-ldl',
'-isystem',
'/usr/include/c++/v1',
'-isystem',
'/usr/local/include',
'-isystem',
'/usr/include/x86_64-linux-gnu',
'-isystem',
'/usr/include',
'-I',
'/usr/local/src/yeppp/1.0.0/library/headers',
'-I',
'/opt/qt/5.1.2/linux/mkspecs/linux-clang',
'-I',
'/opt/qt/5.1.2/linux/include',
'-I',
'/opt/qt/5.1.2/linux/include/QtCLucene',
'-I',
'/opt/qt/5.1.2/linux/include/QtConcurrent',
'-I',
'/opt/qt/5.1.2/linux/include/QtCore',
'-I',
'/opt/qt/5.1.2/linux/include/QtDBus',
'-I',
'/opt/qt/5.1.2/linux/include/QtDeclarative',
'-I',
'/opt/qt/5.1.2/linux/include/QtDesigner',
'-I',
'/opt/qt/5.1.2/linux/include/QtDesignerComponents',
'-I',
'/opt/qt/5.1.2/linux/include/QtGui',
'-I',
'/opt/qt/5.1.2/linux/include/QtHelp',
'-I',
'/opt/qt/5.1.2/linux/include/QtMultimedia',
'-I',
'/opt/qt/5.1.2/linux/include/QtMultimediaQuick_p',
'-I',
'/opt/qt/5.1.2/linux/include/QtMultimediaWidgets',
'-I',
'/opt/qt/5.1.2/linux/include/QtNetwork',
'-I',
'/opt/qt/5.1.2/linux/include/QtOpenGL',
'-I',
'/opt/qt/5.1.2/linux/include/QtOpenGLExtensions',
'-I',
'/opt/qt/5.1.2/linux/include/QtPlatformSupport',
'-I',
'/opt/qt/5.1.2/linux/include/QtPrintSupport',
'-I',
'/opt/qt/5.1.2/linux/include/QtQml',
'-I',
'/opt/qt/5.1.2/linux/include/QtQuick',
'-I',
'/opt/qt/5.1.2/linux/include/QtQuickParticles',
'-I',
'/opt/qt/5.1.2/linux/include/QtQuickTest',
'-I',
'/opt/qt/5.1.2/linux/include/QtScript',
'-I',
'/opt/qt/5.1.2/linux/include/QtScriptTools',
'-I',
'/opt/qt/5.1.2/linux/include/QtSensors',
'-I',
'/opt/qt/5.1.2/linux/include/QtSerialPort',
'-I',
'/opt/qt/5.1.2/linux/include/QtSql',
'-I',
'/opt/qt/5.1.2/linux/include/QtSvg',
'-I',
'/opt/qt/5.1.2/linux/include/QtTest',
'-I',
'/opt/qt/5.1.2/linux/include/QtUiTools',
'-I',
'/opt/qt/5.1.2/linux/include/QtV8',
'-I',
'/opt/qt/5.1.2/linux/include/QtWebKit',
'-I',
'/opt/qt/5.1.2/linux/include/QtWebKitWidgets',
'-I',
'/opt/qt/5.1.2/linux/include/QtWidgets',
'-I',
'/opt/qt/5.1.2/linux/include/QtX11Extras',
'-I',
'/opt/qt/5.1.2/linux/include/QtXml',
'-I',
'/opt/qt/5.1.2/linux/include/QtXmlPatterns'
]
# Set this to the absolute path to the folder (NOT the file!) containing the
# compile_commands.json file to use that instead of 'flags'. See here for
# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
#
# Most projects will NOT need to set this to anything; you can just change the
# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
compilation_database_folder = ''
if compilation_database_folder:
database = ycm_core.CompilationDatabase( compilation_database_folder )
else:
database = None
def DirectoryOfThisScript():
return os.path.dirname( os.path.abspath( __file__ ) )
def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
if not working_directory:
return flags
new_flags = []
make_next_absolute = False
path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
for flag in flags:
new_flag = flag
if make_next_absolute:
make_next_absolute = False
if not flag.startswith( '/' ):
new_flag = os.path.join( working_directory, flag )
for path_flag in path_flags:
if flag == path_flag:
make_next_absolute = True
break
if flag.startswith( path_flag ):
path = flag[ len( path_flag ): ]
new_flag = path_flag + os.path.join( working_directory, path )
break
if new_flag:
new_flags.append( new_flag )
return new_flags
def FlagsForFile( filename ):
if database:
# Bear in mind that compilation_info.compiler_flags_ does NOT return a
# python list, but a "list-like" StringVec object
compilation_info = database.GetCompilationInfoForFile( filename )
final_flags = PrepareClangFlags(
MakeRelativePathsInFlagsAbsolute(
compilation_info.compiler_flags_,
compilation_info.compiler_working_dir_ ),
filename )
else:
relative_to = DirectoryOfThisScript()
final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
return {
'flags': final_flags,
'do_cache': True
} My YCM installation was through:
My llvm/clang version is My libc++ version is:
If you get unable to reproduce this, I think I may have to figure it out myself, I only know this is related with the preview window, only with ycmd. |
Can you repro the issue with the test case/extra conf I posted? |
I have inspected this is a Vim bug, will report it upstream as soon as I can. |
for reference, this is the Vim thread discussing this issue: |
Thanks for reporting this upstream (and providing a patch)! |
If anyone has this problem, you need to update to latest Syntastic. |
Happens sometimes when users tab through the completion menu. Related to #593.
oblitum sorry but which color scheme do you use? |
@lekishvili I use gruvbox, this is my .vimrc: https://gist.github.com/oblitum/5565974 |
@lekishvili from discussion in #1000 I just started using octol/vim-cpp-enhanced-highlight too =) |
@oblitum thank you ) |
I've switched to ycmd and I perceived (I think) some random crashes from time to time, it was sowewhat difficult to reduce the occasion where it would happen consistently, I have a consistent crash in the following situation,
typed
boost::bima
:then tab, tab, tab:
in the fourth tab, vim crashes.
It's aways this situation, going through the popup options with tab, a random crash occurs.
Still not sure whether ycmd is the real cause.
The text was updated successfully, but these errors were encountered: