Skip to content
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 squiggles appear even though headers are discovered #3731

Closed
Georacer opened this issue Jun 5, 2019 · 38 comments
Closed

Intellisense squiggles appear even though headers are discovered #3731

Georacer opened this issue Jun 5, 2019 · 38 comments
Labels
Feature: Configuration An issue related to configuring the extension or IntelliSense Language Service more info needed The issue report is not actionable in its current state

Comments

@Georacer
Copy link

Georacer commented Jun 5, 2019

Type: LanguageService

Hello everyone,
I'm having some issues with the Intellisense feature of the C++ extension of VSCode.

Describe the bug

  • OS and Version: Ubuntu 18.04
  • VS Code Version: 1.34.0
  • C/C++ Extension Version: 0.23.1
  • Other extensions you installed (and if the issue persists after disabling them): Anaconda Extension Pack, Docker, Gitlens, Python and others
  • A clear and concise description of what the bug is:
    I have a ROS workspace, whose source folder I have opened in VSC, with path: "/home/george/ros_workspaces/uav_ftc/src/.
    All local files are visible and all included files which are situated in this folder.

Also, I have included the source files from another program (called ACADO for reference), whose path I have added in the includePath variable of c_cpp extension.

All header files and types of the ACADO source are apparently discovered, since hitting F12 will open and point to the corresponding line.

However, squiggles are broken and exist everywhere the ACADO source is referred. Errors include include errors and undefined identifiers.

I do not wish to turn to Tag Parser engine for intellisense, because apparently it also doesn't squiggle obvious errors, such as actually undefined symbols.

To Reproduce
I'm not sure if I should go all the way and provide you with files for two large projects...

Expected behavior
I expected headers and symbols of the external source files to be parsed and recognized by Intellisense correctly

Screenshots
Example: DifferentialState type looks undefined
image
but hitting F12 on it leads to its definition:
image

Additional context
The local c_cpp_properties.json file:

{
    "configurations": [
        {
            "browse": {
                "databaseFilename": "",
                "limitSymbolsToIncludedHeaders": true
            },
            "includePath": [
                "/home/xxx/UserPrograms/ACADOtoolkit/acado/**",
                "/home/xxx/ros_workspaces/uav_ftc/devel/include",
                "/opt/ros/melodic/include",
                "/home/xxx/ros_workspaces/uav_ftc/src/last_letter/last_letter/include",
                "/home/xxx/ros_workspaces/uav_ftc/src/last_letter/mathutils/include",
                "/home/xxx/ros_workspaces/uav_ftc/src/uav_ftc/include",
                "/home/xxx/ros_workspaces/uav_ftc/src/last_letter/uav_utils/include",
                "/usr/include"
            ],
            "name": "Linux",
            "intelliSenseMode": "gcc-x64",
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c11",
            "cppStandard": "c++17"
        }
    ],
    "version": 5
}

Thank you in advance for your time.
Let me know if additional information is needed or if I have posted in the wrong issue tracker.

@sean-mcmanus
Copy link
Collaborator

F12 on #include does not follow the same paths as IntelliSense error squiggles (we haven't gotten around to fixing that bug yet).

So if you're getting squiggles on the headers it means IntelliSense isn't able to find the files via the includePath used.

Can you run the C/C++: Log Diagnostics command with the file with error squiggles to see what IntelliSense settings are getting used and if the includePath can be fixed?

@sean-mcmanus sean-mcmanus added Language Service more info needed The issue report is not actionable in its current state Feature: Configuration An issue related to configuring the extension or IntelliSense labels Jun 5, 2019
@Georacer
Copy link
Author

Georacer commented Jun 6, 2019

Sure! Here it is. Blurred out my username, though.

-------- Diagnostics - 6/6/2019, 12:17:16 PM
Version: 0.23.1
Translation Unit Mappings:
[/home/<username>/ros_workspaces/uav_ftc/src/uav_ftc/mpc_models/rate_controller_solver.cpp]:
    /home/<username>/ros_workspaces/uav_ftc/src/uav_ftc/mpc_models/rate_controller_solver.cpp
Translation Unit Configurations:
[/home/<username>/ros_workspaces/uav_ftc/src/uav_ftc/mpc_models/rate_controller_solver.cpp]:
    Process ID: 15450
    Memory Usage: 11 MB
    Compiler Path: /usr/bin/gcc
    Includes:
        /home/<username>/ros_workspaces/uav_ftc/devel/include
        /opt/ros/melodic/include
        /home/<username>/ros_workspaces/uav_ftc/src/last_letter/last_letter/include
        /home/<username>/ros_workspaces/uav_ftc/src/last_letter/mathutils/include
        /home/<username>/ros_workspaces/uav_ftc/src/uav_ftc/include
        /home/<username>/ros_workspaces/uav_ftc/src/last_letter/uav_utils/include
        /usr/include/c++/7
        /usr/include/x86_64-linux-gnu/c++/7
        /usr/include/c++/7/backward
        /usr/lib/gcc/x86_64-linux-gnu/7/include
        /usr/local/include
        /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed
        /usr/include/x86_64-linux-gnu
        /usr/include
        /home/<username>/UserPrograms/ACADOtoolkit/acado
    Standard Version: c++17
    IntelliSense Mode: gcc-x64
    Other Flags:
        --g++
        --gnu_version=70400
Total Memory Usage: 11 MB

@Georacer
Copy link
Author

Georacer commented Jun 6, 2019

Maybe this is what is wrong:
Even though in the intellisense configuration window, for the Include Path, I have spectified:

/home/<username>/UserPrograms/ACADOtoolkit/acado/**
/home/<username>/ros_workspaces/uav_ftc/devel/include
/opt/ros/melodic/include
/home/<username>/ros_workspaces/uav_ftc/src/last_letter/last_letter/include
/home/<username>/ros_workspaces/uav_ftc/src/last_letter/mathutils/include
/home/<username>/ros_workspaces/uav_ftc/src/uav_ftc/include
/home/<username>/ros_workspaces/uav_ftc/src/last_letter/uav_utils/include
/usr/include

the acado folder isn't actually parsed recursively; note how the /** is omitted in the diagnostic log.
This makes me think that the actual headers (which reside deeper in the folder) are never actually loaded.

@feijie825
Copy link

F12 on #include does not follow the same paths as IntelliSense error squiggles (we haven't gotten around to fixing that bug yet).

So if you're getting squiggles on the headers it means IntelliSense isn't able to find the files via the includePath used.

Can you run the C/C++: Log Diagnostics command with the file with error squiggles to see what IntelliSense settings are getting used and if the includePath can be fixed?

How can I make it appear again when I disable these squiggles?

@sean-mcmanus
Copy link
Collaborator

@feijie825 You can change the C_Cpp.errorSquiggles setting.

@feijie825
Copy link

@sean-mcmanus Thank you. I've tried to change the settings. But it didn't work.

@sean-mcmanus
Copy link
Collaborator

@feijie825 How did you disable the squiggles originally?

@Victsz
Copy link

Victsz commented Jun 15, 2019

Is it possible to take CMakelists, if there is one, as reference for include path searching?

@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Jun 17, 2019

@Victsz You can use the CMake Tools extension and set the configurationProvider (in c_cpp_properties.json, or the C_Cpp.default one) to "vector-of-bool.cmake-tools".

@Victsz
Copy link

Victsz commented Nov 11, 2019

@Victsz You can use the CMake Tools extension and set the configurationProvider (in c_cpp_properties.json, or the C_Cpp.default one) to "vector-of-bool.cmake-tools".

@sean-mcmanus after cmake tools update,

1.2.1
Thank you to the following CMake Tools contributors: koemai, bjosa, emanspeaks, som1lse, dcourtois, tsing80, andy-held, notskm, thezogoth, yokuyuki, dbird137, fabianogk, randshot.

vector-of-bool has moved on to other things and Microsoft is now maintaining this extension. Thank you vector-of-bool for all of your hard work getting this extension to where it is today!

Breaking changes:

The publisher id changes to ms-vscode.cmake-tools.

I change accordingly
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",

but the intellisense engine not working
image
I tried cmake reconfigure , windows reload, reset intellisense database

@bobbrow
Copy link
Member

bobbrow commented Nov 11, 2019

@Victsz We didn't change the configurationProvider to ms-vscode.cmake-tools yet because we need to make a change to cpptools to support it first. We plan to support both ids during this transition. If you change it back to vector-of-bool.cmake-tools it should work again.

@Victsz
Copy link

Victsz commented Nov 12, 2019

@bobbrow
I did not make the change out of no reason.
In fact, after update cmake tools extension without any setting changes, the intellisense is not working then I had to check release log and tried to solve problem by update configurationProvider setting.
I change back my setting and tired to jump to header but the blue bar just keep looping
image

@sean-mcmanus
Copy link
Collaborator

@Victsz We're releasing a 0.26.2-insiders tomorrow which has a bunch of bug fixes...your issue with CMake tools may be a new issue though that we haven't been able to repro/diagnose yet. Do you know if the regression is caused by the newer version of the C/C++ extension or the CMake extension?

I got CMake Tools to be configured on Linux (it keeps choosing the wrong kit on startup though, but it gets fixed after I choose "Unspecified").

Do your logs show the correct paths in the output "Custom configuration received: { … "includePath": [....]""

@Victsz
Copy link

Victsz commented Nov 12, 2019

It is about the newer verison of CMAKE tools which in my case update just 2 or 3days ago.

Its a remote ssh project from win10 and it can find the kit correctly

I`m not sure about the last question, from my point of view, its not actually parsing the cmake files.

@Victsz
Copy link

Victsz commented Nov 12, 2019

Is it possible to provide a way to rollback CMAKE tools, I tried pick another version but it`s not working.
image

@sean-mcmanus
Copy link
Collaborator

@Victsz I hit the same issue. See microsoft/vscode-cmake-tools#904 .

If you look at your C/C++ logs you can see the input includePaths the CMake Tools extensions sends us.

@Victsz
Copy link

Victsz commented Nov 15, 2019

@sean-mcmanus After cmake 1.2.2 I can jump to header definition.
But the intellisense engine does not prompt for variables.
image
image
image

After edit "configurations": [["includePath"]] , the intellisense can work properly

@sean-mcmanus
Copy link
Collaborator

@Victsz I don't understand. What does "edit configurations: [["includePath"]]" mean? Is there a bug still? With CMake Tools or the C/C++ extension?

@Victsz
Copy link

Victsz commented Dec 5, 2019

@sean-mcmanus
I have several issues,
After CMake tools previous update, the cpp-tools configurationProvider seems not working, cannot jump to definition.

I had to add headers in to Current Configuration {includePath} as shown below, now it can jump to definition but cannot find reference. The weird thing is it can jump to definition from the same expression that cannot find reference.

image

Current Configuration:
-------- Diagnostics - 12/5/2019, 2:09:31 PM
Version: 0.26.2
Current Configuration:
{
"name": "Linux",
"defines": [],
"compilerPath": "/usr/bin/g++",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64",
"configurationProvider": "vector-of-bool.cmake-tools",
"includePath": [
"${workspaceFolder}/",
"${workspaceFolder}/reference",
"${workspaceFolder}/reference/factor_factory",
"${workspaceFolder}/reference/nautilus.library",
"${workspaceFolder}/reference/nautilus.library/nautilus/nautilus.execution"
],
"compilerArgs": [],
"browse": {
"path": [
"${workspaceFolder}/
",
"${workspaceFolder}/reference",
"${workspaceFolder}/reference/factor_factory",
"${workspaceFolder}/reference/nautilus.library",
"${workspaceFolder}/reference/nautilus.library/nautilus/nautilus.execution"
],
"limitSymbolsToIncludedHeaders": true
}
}
Translation Unit Mappings:
[ /home/victor/Git2/Strategy/olympia/src/Olympia/OlympiaBase.cc ]:
/home/victor/Git2/Strategy/olympia/src/Olympia/OlympiaBase.cc
[ /home/victor/Git2/Strategy/olympia/src/Olympia/OlympiaTradeLogic.cc ]:
/home/victor/Git2/Strategy/olympia/src/Olympia/OlympiaTradeLogic.cc
[ /home/victor/Git2/Strategy/olympia/src/Olympia/OlympiaHelper.cc ]:
/home/victor/Git2/Strategy/olympia/src/Olympia/OlympiaHelper.cc
Translation Unit Configurations:
[ /home/victor/Git2/Strategy/olympia/src/Olympia/OlympiaBase.cc ]:
Process ID: 21342
Memory Usage: 28 MB
Includes:
/home/victor/Git2/Strategy/olympia/reference
/home/victor/Git2/factor_factory
/home/victor/Git2/nautilus.library.header
/home/victor/Git2/nautilus.library.header/nautilus
/home/victor/Git2/nautilus.library.header/nautilus/nautilus.execution
/home/victor/Git2/nautilus.library.header/nautilus/savanna
/home/victor/Git2/nautilus.library.header/nautilus/RPC
/home/victor/Git2/nautilus.library.header/nautilus/SimpleSignal
/home/victor/Git2/Strategy/olympia/build/messmer_gitversion
/usr/include/c++/9
/usr/include
Standard Version: c++17
IntelliSense Mode: gcc-x64
Other Flags:
--g++
--gnu_version=80100
[ /home/victor/Git2/Strategy/olympia/src/Olympia/OlympiaTradeLogic.cc ]: not ready
Process ID: 21449
Memory Usage: 4 MB
Includes:
/home/victor/Git2/Strategy/olympia/reference
/home/victor/Git2/factor_factory
/home/victor/Git2/nautilus.library.header
/home/victor/Git2/nautilus.library.header/nautilus
/home/victor/Git2/nautilus.library.header/nautilus/nautilus.execution
/home/victor/Git2/nautilus.library.header/nautilus/savanna
/home/victor/Git2/nautilus.library.header/nautilus/RPC
/home/victor/Git2/nautilus.library.header/nautilus/SimpleSignal
/home/victor/Git2/Strategy/olympia/build/messmer_gitversion
/usr/include/c++/9
/usr/include
Standard Version: c++17
IntelliSense Mode: gcc-x64
Other Flags:
--g++
--gnu_version=80100
[ /home/victor/Git2/Strategy/olympia/src/Olympia/OlympiaHelper.cc ]:
Process ID: 21470
Memory Usage: 28 MB
Includes:
/home/victor/Git2/Strategy/olympia/reference
/home/victor/Git2/factor_factory
/home/victor/Git2/nautilus.library.header
/home/victor/Git2/nautilus.library.header/nautilus
/home/victor/Git2/nautilus.library.header/nautilus/nautilus.execution
/home/victor/Git2/nautilus.library.header/nautilus/savanna
/home/victor/Git2/nautilus.library.header/nautilus/RPC
/home/victor/Git2/nautilus.library.header/nautilus/SimpleSignal
/home/victor/Git2/Strategy/olympia/build/messmer_gitversion
/usr/include/c++/9
/usr/include
Standard Version: c++17
IntelliSense Mode: gcc-x64
Other Flags:
--g++
--gnu_version=80100
Total Memory Usage: 60 MB

@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Dec 6, 2019

Adding paths to the includePath should only affect things if the configuration provider fails to provide the includePath. You might want to file a bug with the CMake Tools extension if you haven't already: https://github.com/microsoft/vscode-cmake-tools/issues .

If the Go to Def is working but Find All References works, it means there is a failure to create your database (so Go to Def on definitions in other TUs should also fail as well). You might want to try setting your C_Cpp.default.browse.databaseFilename to something like "${workspaceFolder}/vs/vc.db" to ensure that it is able to get created (assuming it's failing at it's default location). Killing any dangling/old process using the database may also fix it (i.e. #4508 (comment)).

Does running "/usr/bin/g++ --version" show 8.1 as the version? If not, it looks like we may also be failing to query your compiler for includes/defines, possibly due to the compiler output being in a different language.

@Victsz
Copy link

Victsz commented Dec 6, 2019

@sean-mcmanus I created an issue microsoft/vscode-cmake-tools#959, it would be great if you can help to explain with more details when necessary, in case I did not state clear enough.

Yes I found many dangling process after close my vscode, and killed them.
And set C_Cpp.default.browse.databaseFilename, the db file is created along with db-shm and db-wal
Now find reference keep looping and without return.

I also tried reset c++ intellisense db but nothing special and I have no idea if the reset action is successful

"/usr/bin/g++ --version" returns 9.1.1 same as the selected config

@Victsz
Copy link

Victsz commented Dec 13, 2019

@sean-mcmanus
The cmake tools provides correct headers and cmake setting
The CMake project outline view on the side panel is correct

And the kit should be correct as well because I have no problem to build the project.

The log for
Custom configuration provider 'CMake Tools' registered
Custom configurations received:
uri: file:///home/victor/Git2/Strategy/olympia/src/Olympia/OlympiaTradeLogic.cc
config: {
"defines": [
"VOlympia_EXPORTS",
"NDEBUG"
],
"standard": "c++17",
"includePath": [
"/home/victor/Git2/Strategy/olympia/reference",
"/home/victor/Git2/Strategy/olympia/reference/factor_factory",
"/home/victor/Git2/Strategy/olympia/reference/nautilus.library",
"/home/victor/Git2/Strategy/olympia/reference/nautilus.library/nautilus",
"/home/victor/Git2/Strategy/olympia/reference/nautilus.library/nautilus/nautilus.execution",
"/home/victor/Git2/Strategy/olympia/reference/nautilus.library/nautilus/savanna",
"/home/victor/Git2/Strategy/olympia/reference/nautilus.library/nautilus/RPC",
"/home/victor/Git2/Strategy/olympia/reference/nautilus.library/nautilus/SimpleSignal",
"/home/victor/Git2/Strategy/olympia/reference/nautilus.library/nautilus/fastmap/include",
"/home/victor/Git2/Strategy/olympia/reference/nautilus.library/event",
"/home/victor/Git2/Strategy/olympia/reference/nautilus.library/RPC",
"/home/victor/Git2/Strategy/olympia/reference/nautilus.library/SimpleSignal",
"/home/victor/Git2/Strategy/olympia/build/messmer_gitversion"
],
"intelliSenseMode": "clang-x64",
"compilerPath": "/usr/bin/g++",
"compilerArgs": [
"-g",
"-O3",
"-feliminate-unused-debug-types",
"-pipe",
"-Wall",
"-Wp,-D_FORTIFY_SOURCE=2",
"-fexceptions",
"-fstack-protector",
"--param=ssp-buffer-size=32",
"-Wformat",
"-Wformat-security",
"-m64",
"-fasynchronous-unwind-tables",
"-Wp,-D_REENTRANT",
"-ftree-loop-distribute-patterns",
"-Wl,-z",
"-Wl,now",
"-Wl,-z",
"-Wl,relro",
"-fno-semantic-interposition",
"-ffat-lto-objects",
"-fno-signed-zeros",
"-fno-trapping-math",
"-fassociative-math",
"-Wl,-sort-common",
"-Wl,--enable-new-dtags",
"-mtune=skylake",
"-fvisibility-inlines-hidden",
"-Wl,--enable-new-dtags",
"-Wall",
"-Wextra",
"-Wno-unused-parameter",
"-Wno-sign-compare",
"-O3",
"-DNDEBUG",
"-fPIC",
"-std=gnu++17"
]
}
Custom browse configuration received: {
"browsePath": [
"/home/victor/Git2/Strategy/olympia/reference",
"/home/victor/Git2/Strategy/olympia/reference/factor_factory",
"/home/victor/Git2/Strategy/olympia/reference/nautilus.library",
"/home/victor/Git2/Strategy/olympia/reference/nautilus.library/nautilus",
"/home/victor/Git2/Strategy/olympia/reference/nautilus.library/nautilus/nautilus.execution",
"/home/victor/Git2/Strategy/olympia/reference/nautilus.library/nautilus/savanna",
"/home/victor/Git2/Strategy/olympia/reference/nautilus.library/nautilus/RPC",
"/home/victor/Git2/Strategy/olympia/reference/nautilus.library/nautilus/SimpleSignal",
"/home/victor/Git2/Strategy/olympia/reference/nautilus.library/nautilus/fastmap/include",
"/home/victor/Git2/Strategy/olympia/reference/nautilus.library/event",
"/home/victor/Git2/Strategy/olympia/reference/nautilus.library/RPC",
"/home/victor/Git2/Strategy/olympia/reference/nautilus.library/SimpleSignal",
"/home/victor/Git2/Strategy/olympia/build/messmer_gitversion",
"/home/victor/Git2/Strategy/olympia/src/Helper",
"/home/victor/Git2/Strategy/olympia/src/Olympia",
"/home/victor/Git2/Strategy/olympia/src"
],
"standard": "c++17",
"compilerPath": "/usr/bin/g++",
"compilerArgs": [
"-g",
"-O3",
"-feliminate-unused-debug-types",
"-pipe",
"-Wall",
"-Wp,-D_FORTIFY_SOURCE=2",
"-fexceptions",
"-fstack-protector",
"--param=ssp-buffer-size=32",
"-Wformat",
"-Wformat-security",
"-m64",
"-fasynchronous-unwind-tables",
"-Wp,-D_REENTRANT",
"-ftree-loop-distribute-patterns",
"-Wl,-z",
"-Wl,now",
"-Wl,-z",
"-Wl,relro",
"-fno-semantic-interposition",
"-ffat-lto-objects",
"-fno-signed-zeros",
"-fno-trapping-math",
"-fassociative-math",
"-Wl,-sort-common",
"-Wl,--enable-new-dtags",
"-mtune=skylake",
"-fvisibility-inlines-hidden",
"-Wl,--enable-new-dtags",
"-Wall",
"-Wextra",
"-Wno-unused-parameter",
"-Wno-sign-compare",
"-O3",
"-DNDEBUG",
"-fPIC",
"-std=gnu++17"
]
}
cpptools/pauseParsing
cpptools/clearCustomConfigurations
terminating child process: 31672
still alive, killing...
not exited yet. Will sleep for 10 milliseconds and try again.
not exited yet. Will sleep for 20 milliseconds and try again.
Failed to read response from server: 22
Update IntelliSense time (sec): 2.098
Closing the communication channel.
Shutting down IntelliSense server: /home/victor/Git2/Strategy/olympia/src/Olympia/OlympiaTradeLogic.cc
Checking for syntax errors: file:///home/victor/Git2/Strategy/olympia/src/Olympia/OlympiaTradeLogic.cc
cpptools/didChangeCustomConfiguration
Attempting to get defaults from compiler in "compilerPath" property: '/usr/bin/g++'
sending compilation args for /home/victor/Git2/Strategy/olympia/src/Olympia/OlympiaTradeLogic.cc
I think some how during parsing files the intellisesen engine is crashed.

To ensure my project is setup properly, I open the project in QTCreator and everything is ok there.

@sean-mcmanus
Copy link
Collaborator

@Victsz Yeah, you're hitting a crash (the "Failed to read response"). If you could attach a debugger to the Microsoft.VSCode.CPP.IntelliSense.Msvc process before the crash occurs and get a call stack that would help identify the issue (you could copy/paste the file contents if the crash occurs too soon after opening the file).

Also, we don't understand the -std=gnu++17 yet, so that might cause issues. You might need to add some defines like _GNU_SOURCE as a partial workaround.

Using -E to obtain a preprocessed TU file may help in obtaining an isolated repro.

@Victsz
Copy link

Victsz commented Dec 15, 2019

@sean-mcmanus
Dont know how to attach debugger to Microsoft.VSCode.CPP.IntelliSense.Msvc process, can you provide more details.
I add add_definitions(-D_GNU_SOURCE) in the cmake file and add "defines": ["_GNU_SOURCE"] in .vscode/c_cpp_properties.jsonbut no difference, the"-std=gnu++17"` is still there

"Using -E to obtain a preprocessed TU" where I can use -E

Custom configurations received:
uri: file:///home/demo/DemoDev/ntftemplate/src/Extern.cc
config: {
"defines": [
"Eel_EXPORTS",
"_GNU_SOURCE"
],
"standard": "c++17",
"includePath": [
"/home/demo/DemoDev/ntftemplate/reference",
"/home/demo/DemoDev/ntftemplate/reference/nautilus.library.header",
"/home/demo/DemoDev/ntftemplate/reference/nautilus.library.header/nautilus",
"/home/demo/DemoDev/ntftemplate/reference/nautilus.library.header/nautilus/nautilus.execution",
"/home/demo/DemoDev/ntftemplate/reference/nautilus.library.header/nautilus/RPC",
"/home/demo/DemoDev/ntftemplate/reference/nautilus.library.header/nautilus/SimpleSignal",
"/home/demo/DemoDev/ntftemplate/reference/nautilus.library.header/nautilus/savanna",
"/home/demo/DemoDev/ntftemplate/build/messmer_gitversion"
],
"intelliSenseMode": "clang-x64",
"compilerPath": "/usr/bin/g++",
"compilerArgs": [
"-O3",
"-feliminate-unused-debug-types",
"-pipe",
"-Wall",
"-Wp,-D_FORTIFY_SOURCE=2",
"-fexceptions",
"-fstack-protector",
"--param=ssp-buffer-size=32",
"-Wformat",
"-Wformat-security",
"-m64",
"-fasynchronous-unwind-tables",
"-Wp,-D_REENTRANT",
"-ftree-loop-distribute-patterns",
"-Wl,-z",
"-Wl,now",
"-Wl,-z",
"-Wl,relro",
"-fno-semantic-interposition",
"-ffat-lto-objects",
"-fno-signed-zeros",
"-fno-trapping-math",
"-fassociative-math",
"-Wl,-sort-common",
"-Wl,--enable-new-dtags",
"-mtune=skylake",
"-fvisibility-inlines-hidden",
"-Wl,--enable-new-dtags",
"-g",
"-fPIC",
"-std=gnu++17"
]
}

@sean-mcmanus
Copy link
Collaborator

Yeah, you won't notice any difference in the logging output (the gnu++17 in the output gets overwritten by us with "c++17"), but it might fix issues that relied on the _GNU_SOURCE define that would get set if handled it the gnu++17 correctly.

You would use -E in your build command...you also might need to output the results to some file.

There's some debugging info at https://code.visualstudio.com/docs/cpp/cpp-debug . You basically just create a launch.json file from the VS Code Debug view "gear icon", add an "attach" configuration for your debugger, and if you're on Linux you need to set the "program" to something like "/home/<user>/.vscode/ms-vscode.cpptools-0.26.2/bin/Microsoft.VSCode.CPP.Extension.linux", then click the green arrow to attach, and then repro the crash and it should break and show a call stack (pasting the code that causes the crash is the easiest way to avoid it crashing too early after opening a file). Let me know if you hit any issues.

@Victsz
Copy link

Victsz commented Dec 23, 2019

@sean-mcmanus I try use gdb attach to Microsoft.VSCode.CPP.Extension.linux, but the process has not crashed.
image
how can I attach to the child process?

image

Meanwhile, the jump to definition works fine, but neither find reference nor auto completion

Oh I attached to one of the child processes,hope it will help

image
image

@Victsz
Copy link

Victsz commented Dec 23, 2019

image
The pid 21797 is trigger by find reference, but it just stucked at phread_cond_timedwait.

@Victsz
Copy link

Victsz commented Dec 23, 2019

image
3hours later the process is still running

@Victsz
Copy link

Victsz commented Dec 23, 2019

@sean-mcmanus
Downgrade to 0.26.0, find reference and auto-completion works well!
Shall I fire a new issue?

@sean-mcmanus
Copy link
Collaborator

@Victsz Yeah, it's easier to track issues if they're in separate issues. I don't see any crash call stacks. You appear to be attaching to the main process instead of Microsoft.VSCode.CPP.IntelliSense.Msvc.linux, which is what was crashing previously. I'm not sure your comment about "3 hours later the process is still running"...is our extension supposed to be running or is it dangling?

I don't understand how a Microsoft.VSCode.CPP.Extension process is being launched by a Find All References operation. Are you using a multi-root workspace? The top of the call stack with the pthread waits is insufficient for us to tell what it's stuck on -- we need the full call stack. And the processes have multiple threads, many of which are waiting under normal conditions. It might be easier to use VS Code to debug so you can see the call stacks for all the threads, unless you're familiar with the correct gdb commands to use to get the same info.

@Victsz
Copy link

Victsz commented Dec 24, 2019

@sean-mcmanus
"3 hours later the process is still running" -> the subprocess, id 21797, not the main process which for sure it is something wrong

"I don't understand how a Microsoft.VSCode.CPP.Extension process is being launched by a Find All References operation."
It will fire a subprocess, see from my screenshot, after I click FInd reference, it will fork a process ID 21797 which is the process that never end.

  1. I clear all vscode process
  2. Open project
  3. reset intellisense db
  4. now we have the first and only CPP.Extension thread, id 20806.
  5. Find all reference, pid 20806 forked a subprocess pid 21797 which never ends

And, down grade to 0.26.0 solved the issue.

@sean-mcmanus
Copy link
Collaborator

21797 is the IntelliSense process. One IntelliSense process should be created after a file is first opened -- it is not supposed to end unless it's "supposed" to. Doing Find All References can launch multiple temporary IntelliSense processes that should ago away after the FAR is done. Is the IntelliSense process not crashing for you? In the screenshot I saw "No IL available" which is a non-crashing failure.

@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Dec 24, 2019

Actually, looking again -- it doesn't appear from your screenshot that 21797 is the IntelliSense process (maybe I'm not understand what the output is showing). Do you see a Microsoft.VSCode.CPP.IntelliSense.Msvc.linux process when you open a file? If other main processes are launching, that would imply the previous one is crashing.

@Victsz
Copy link

Victsz commented Dec 24, 2019

21797 is the IntelliSense process. One IntelliSense process should be created after a file is first opened -> no it is not. you can tell from the process time , see below, 21797 was started at 17:54 one mintue later than 20806.
image
I did not pay attention to "IntelliSense.Msvc.linux " because "if you're on Linux you need to set the "program" to something like "/home//.vscode/ms-vscode.cpptools-0.26.2/bin/Microsoft.VSCode.CPP.Extension.linux"" quote from your previous request.

And since I am doing well on 0.26.0, I dont have the environment to reproduce.

But Im pretty sure you are hitting some forever loop issue which is induced since 0.26.1

@Victsz
Copy link

Victsz commented Dec 24, 2019

More info can see from this screenshot, it is about the gdb on main process 20806.
After find reference it fired a subprocess pid 21797

image

@sean-mcmanus
Copy link
Collaborator

Your screenshot shows Microsoft.VSCode.CPP.Extension.linux -- is the process name not correct?

To debug Microsoft.VSCode.CPP.IntelliSense.Msvc.linux (the IntelliSense process), you just change the "program" to be that (my example was with the main process, sorry about the misleading example).

If you don't see a Microsoft.VSCode.CPP.IntelliSense.Msvc.linux process after opening a file (and after recursive includes processing is finished) then it would imply the process is crashing or falling back to the Tag Parser mode due to missing includes. Doing a Find All References could cause a crashed IntelliSense process to respawn.

I don't see evidence of a "forever loop". Do you mean a deadlock? Is there endless CPU usage?

In order for us to identify/fix the crash, we would need you to open a blank .cpp, attach to the IntelliSense process, paste in the crashing code, and then provide the call stack of the crash. If you believe the process is stuck we'd need a call stack for that as well.

@Victsz
Copy link

Victsz commented Dec 24, 2019

I don't see evidence of a "forever loop". Do you mean a deadlock? Is there endless CPU usage? -> I can see the find all reference bar keep looping for 3 hours until i killed that 21797, this might be the most obvious tell.

It is a remote project, after setting launch.json it cannot find process.

I am on a tight schedule will get back to this issue latter.

Thanks for your help.

@bobbrow
Copy link
Member

bobbrow commented Jun 11, 2020

We need more information to fully investigate this issue. If you update to the latest version of the extension and your issue persists, please reply with additional information that can help us investigate your issue.

@bobbrow bobbrow closed this as completed Jun 11, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Oct 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature: Configuration An issue related to configuring the extension or IntelliSense Language Service more info needed The issue report is not actionable in its current state
Projects
None yet
Development

No branches or pull requests

5 participants