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

Microsoft.VSCode.CPP.IntelliSense.Msvc.darwin keeps consuming a core #981

Closed
dirkvdb opened this issue Aug 20, 2017 · 13 comments
Closed

Microsoft.VSCode.CPP.IntelliSense.Msvc.darwin keeps consuming a core #981

dirkvdb opened this issue Aug 20, 2017 · 13 comments
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service

Comments

@dirkvdb
Copy link

dirkvdb commented Aug 20, 2017

OS: MacOS Sierra 10.12.6
VSCode: 1.15.1
CppTools: 0.12.3

When I open my project in vscode the intellisense process starts using all the cpu and never stops. Even if I leave it running for hours.
The little red flame in the bottom right says "Parsing..."
Hovering over a symbol says: "Loading..."

But it never exits this state. If I shutdown vscode the Microsoft.VSCode.CPP.IntelliSense.Msvc.darwin process keeps running and consuming a core until I do a Force quit.

Below is my config and I also attached a sample of the intellisense process.
If you need more info the issue is 100% reproducible, so just let me know.

{
    "configurations": [
        {
            "name": "Mac",
            "includePath": [
                "${workspaceRoot}",
                "${workspaceRoot}/modules/upnp/inc",
                "${workspaceRoot}/modules/utils/inc",
                "${workspaceRoot}/modules/audio/inc",
                "${workspaceRoot}/build/local-clang4/include",
                "${workspaceRoot}/modules/image/inc",
                "/usr/include",
                "/usr/local/include",
                "/usr/local/include/c++/v1",
                "/usr/include/machine"
            ],
            "browse": {
                "path": [
                    "${workspaceRoot}/modules/upnp/inc",
                    "${workspaceRoot}/modules/utils/inc",
                    "${workspaceRoot}/modules/audio/inc",
                    "${workspaceRoot}/build/local-clang4/include",
                    "${workspaceRoot}/modules/image/inc",
                    "/usr/include",
                    "/usr/local/include",
                    "/usr/local/include/c++/v1"
                ]
            },
            "intelliSenseMode": "clang-x64"
        }
}

Sample of Microsoft.VSCode.CPP.IntelliSense.Msvc.darwin.txt

@ghost
Copy link

ghost commented Aug 27, 2017

I am suffering the same issue.
Sometimes it takes nearly 400% CPU......See below.
29738906-e9e3820c-8a62-11e7-8287-b130afcf09b3

VSCode Version: 1.15.1
OS Version: macOS 10.12.6

Only C/C++ tools and C++ intellisence extension installed.

@bobbrow
Copy link
Member

bobbrow commented Aug 29, 2017

Are either of you able to share a project or code file that reproduces this error? All I can tell from the sample is that the IntelliSense engine is parsing the file.

@heraclitusq
Copy link

heraclitusq commented Aug 29, 2017

Encountered the same problem just now while exploring the flexible array member feature in C struct.
OS: MacOS 10.12.6
VSCode: 1.15.1
C/C++ Plugin: 0.12.3

After tried a while, narrowed down the problem to be occurring with below code:

#include <stdio.h>

typedef struct Pixel {
    int r;
    int g;
    int b;
} px;

typedef struct Matrix {
    int width;
    int height;
    px pixel[][];
} matrix;

int main(int argc, char *argv[])
{
    return 0;
}

the line px pixel[][] triggers the issue. (I know it's not legitimate now as the clang will throw error about it.)
Hope this info could do some help with the investigation.

@dirkvdb
Copy link
Author

dirkvdb commented Aug 29, 2017

To reproduce it with my project:

git clone --recursive https://github.com/dirkvdb/doozy
cd ./doozy && ./bootstrap.sh native && code .

Then Cmd+p and open upnp.http.functions.cpp

The bootstrap script will take a while as it sets up all the project dependencies (ffmpeg, libpng, libjpeg, boost, ... ) but is necessary as it puts all the third party headers in place.

This does require cmake, autotools, yasm, a working compiler, ... in order for the bootstrap to succeed

@ghost
Copy link

ghost commented Aug 30, 2017

In my case, reproduce as follows:

  1. git clone https://github.com/virgo-coder/EdgeDrawing
  2. Open EdgeDrawing directory in VSCode
  3. Add include path "${workspaceRoot}/include", it looks like this
"configurations": [
        {
            "name": "Mac",
            "includePath": [
                "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1",
                "/usr/local/include",
                "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include",
                "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include",
                "/usr/include",
                "/usr/include/machine",
                "${workspaceRoot}", 
                "${workspaceRoot}/include"
            ],
            "defines": [],
            "intelliSenseMode": "clang-x64",
            "browse": {
                "path": [
                    "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1",
                    "/usr/local/include",
                    "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include",
                    "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include",
                    "/usr/include",
                    "/usr/include/machine",
                    "${workspaceRoot}", 
                    "${workspaceRoot}/include"
                ],
                "limitSymbolsToIncludedHeaders": true,
                "databaseFilename": ""
            }
        },
  1. open examples/example.cpp, it always says "loading" when I point to any symbol. At the same time, Microsoft.VSCode.CPP.IntelliSense.Msvc.darwin keeps consuming a core.

OS Version: macOS 10.12.6
VSCode Version: 1.15.1
C/C++: 0.12.3
C++ Intellisense: 0.2.2

@bobbrow
Copy link
Member

bobbrow commented Aug 30, 2017

Thanks everyone! I'll take a look at these samples.

@bobbrow
Copy link
Member

bobbrow commented Aug 30, 2017

@heraclitusq, the code you posted results in an infinite loop in the front end compiler. I passed your case on to the compiler team.

@dirkvdb and @virgo-coder, I can reproduce your issues as well, but haven't determined the root cause yet.

@heraclitusq
Copy link

Thanks @bobbrow .

@bobbrow
Copy link
Member

bobbrow commented Aug 31, 2017

@dirkvdb and @virgo-coder, your cases are the same bug, but a different infinite loop than @heraclitusq. I am passing your issue over to the compiler team as well.

@ghost
Copy link

ghost commented Aug 31, 2017

@bobbrow Thanks :)

@seryoni
Copy link

seryoni commented Sep 27, 2017

👍 on this issue. Unfortunately i have to defer to a different IDE :-(

@bobbrow bobbrow added the fixed Check the Milestone for the release in which the fix is or will be available. label Oct 3, 2017
@bobbrow
Copy link
Member

bobbrow commented Oct 5, 2017

0.13.1 has a patch for the issues reported in this thread until I get a proper fix from the compiler team.
I force IntelliSense to exit parsing when the conditions are detected which means you will get incomplete/incorrect IntelliSense for the affected translation units, but we no longer get stuck in an infinite loop.

@bobbrow bobbrow closed this as completed Oct 5, 2017
@dirkvdb
Copy link
Author

dirkvdb commented Oct 6, 2017

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
None yet
Development

No branches or pull requests

4 participants