-
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
static_assert error crashes YCM #2364
Comments
Thanks for the report. I can repro this crash. I have found some crashes in libclang 3.9 myself recently. This might be related. |
stack trace:
|
This is the diagnostic i think it should be reporting:
|
OK. I havre reproduced this in a debugger, and can confirm it is a libclang bug. for the test file: int main() {
static_assert(false);
} we hit an assert in libclang.
relevant code snippets from ycmd:
we are hitting this assert
Called from context:
The diagnostic in question is actually warning that the second parameter being missing is a c++1z extension. @d0k @r4nt thoughts? to raise this with clang team would we need a test case uniquely using libclang? |
Also, kudos to lldb. That's some seriously good debugging power (once i got it working) |
OK so the patch is trivial and fixes it.
just need a test case. ycmd test case that now "passes": @IsolatedYcmd
def Diagnostic_Crash_test( app ):
contents = ReadFile( PathToTestFile( 'crash.cc' ) )
#import clewn.vim as clewn; clewn.pdb()
event_data = BuildRequest( contents = contents,
event_name = 'FileReadyToParse',
filetype = 'cpp',
compilation_flags = [ '-x', 'c++', '-std=c++11' ] )
response = app.post_json( '/event_notification', event_data ).json
pprint( response )
assert( False )
|
@puremourning I want some of your superpowers. :D |
Looks like it was fixed upstream recently llvm-mirror/clang@e3a335e (sadly without a test case). Does it still reproduce with trunk libclang? |
thanks @d0k will try now |
@d0k thanks (sorry I should have checked), master does indeed fix it. @mikelui I'd like to close this as not a YCM bug. We track the latest clang releases pretty much immediately after release so we will pick up this upstream fix as soon as it lands, and we're probably going to forget to mention this issue when we do :) I do feel like we should handle these server crashes better however. The Vim tracebacks completely break the workflow which is against our whole principle. That said, that's sort of orthogonal to fixing this particular crash, and I know @micbou was looking at this a while back. If you use this |
As mentioned, this is not a YCM bug, but an upstream one. It can be worked around by building trunk clang and using the full installation instructions until such a time as the patch is released and we upgrade to that version of libclang. |
Issue Prelude
Please complete these steps and check these boxes (by putting an
x
insidethe brackets) before filing your issue:
Frequently Asked Questions section.
about to report and couldn't find an answer to my problem. (Example Google
search.)
vim --version
.:YcmDebugInfo
.:YcmToggleLogs stderr
.version) I am using.
my issue.
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.
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
[If filing a bug report, please include a list of steps that describe how to
reproduce the bug you are experiencing. Also include test code if relevant.]
The following example crashes YCM in vim (did a :PluginUpdate and recompile just before reporting the issue)
:YcmDiags
The following example DOES NOT crash YCM (no errors)
:YcmDiags
Any other coding errors seem to be detected correctly in my current configuration.
:YcmDebugInfo
:YcmToggleLogs stderr
I'm guessing the logs are minimal due to the server crashing.
On 64-bit ArchLinux
ycmd compiled with libclang 3.9 (
./install.py --clang-completer
).If I compile the erroring code with my system clang (3.8.1) I get the correct error/warning message. Untested wtih clang 3.9.
Flags passed to libclang/ycm:
The text was updated successfully, but these errors were encountered: