-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
IntelliSense crashing when hovering over certain C++ types of data. #11510
Comments
Hi @conkerkh . Thanks for letting us know. Could isolate the issue into a code example that reproduces the problem, which we could use to investigate further? |
I would be happy to help here, however I can't easily reproduce this problem. It's crashing only in one of my projects, and I have no clue how to find out which header is causing this issue. If you have any suggestion how to get information from gdb where exactly it fails I could try to write a sample code that reproduces the problem. Debug info from C/C++ plugin doesn't say much |
Hi @conkerkh . The crash would be related to code in the file open at the time, or one of the headers it includes, and possibly related to what is being hovered over. I'd suggest temporarily reducing the source file to only a small bit of code. If the issue repro's, start removing unused headers. Alternatively, you might try generating a preprocessed file (i.e. using the |
I managed to reproduce it with this piece of code:
This code has some mistakes. It may be possible that the if statement inside "Something" doesn't make a difference. |
Hi @conkerkh . Thanks for the reduced code. Unfortunately, I'm not able to reproduce a crash with this code, with 1.17.5 of the C/C++ Extension, on either Ubuntu (w/clang-16) or on macOS. If you create a fresh folder and move this code into it, does the crash still repro for you? Is there anything else (other than hovering over the various identifiers) that you are doing that may be necessary to repro the crash? It's possible there may be some details about your configuration, or |
I used GCC compilers, so if you select g++ for compilerPath in c_cpp_properties.json file it should work with this example. Looks like clang will mark the line with _cb[0] as an error. For this example:
|
Hi @conkerkh . Thanks for the clarification. I can reproduce the crash when using a GGC intelliSense mode on Linux. We will investigate further. |
Environment
Bug Summary and Steps to Reproduce
Bug Summary:
cpptools-srv is crashing in some C++ files, looking at the stack trace of a crashing thread it might have something to do with templates but I'm not sure. It's impossible to hover over some types of data in C++ sources (hovering over them will crash cpptools-srv)
Steps to reproduce:
Hover over anything in a C++ source that doesn't get parsed correctly by cpptools-srv
Expected behavior:
Get a usual Intellisense prompt
Configuration and Logs
Other Extensions
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: