Vscode-cpptools: Infinite loop in the Intellisense process

Created on 29 Nov 2017  路  6Comments  路  Source: microsoft/vscode-cpptools

Steps to reproduce:

  • Install vs code and the official C/C++ extension by Microsoft
  • git clone https://github.com/python/cpython
  • cd cpython
  • code .
  • ctrl-p to open "Modules/_pickle.c"

Problem

The following process runs in the background with 100% CPU usage:

/home/testuser/.vscode/extensions/ms-vscode.cpptools-0.14.3/bin/Microsoft.VSCode.CPP.IntelliSense.Msvc.linux

There is also the following process:

/home/testuser/.vscode/extensions/ms-vscode.cpptools-0.14.3/bin/Microsoft.VSCode.CPP.Extension.linux

All those processes stay alive after exiting VS Code. I have to kill Microsoft.VSCode.CPP.IntelliSense.Msvc.linux manually to terminate it. When I do not kill it seems to run for ever (I waited at least 20 min) and it was still running with 100% CPU.

Environment:

  • Ubuntu Linux 16.04
  • VS Code 1.18.1
  • vscode-cpp-tools 0.14.2

I created a new testuser account and installed no other extension besides vscode-cpp-tools. My settings.json is empty. I tried to use:

"C_Cpp.intelliSenseEngine": "Default"

instead but does not seem to fix the problem.

Here is the output of the log of the C/C++ extension:

IntelliSense Engine = Default.
The extension will use the Tag Parser for IntelliSense when #includes don't resolve.
Autocomplete is enabled.
Error squiggles are enabled.
File exclude: **/.git
File exclude: **/.svn
File exclude: **/.hg
File exclude: **/CVS
File exclude: **/.DS_Store
File exclude: **/.vscode
Search exclude: **/node_modules
Search exclude: **/bower_components
Search exclude: **/.vscode
Code browsing service initialized
  Folder: /usr/lib/gcc/x86_64-linux-gnu/5/include/ will be indexed
  Folder: /usr/local/include/ will be indexed
  Folder: /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/ will be indexed
  Folder: /usr/include/ will be indexed
  Folder: /home/testuser/code/cpython/ will be indexed
Discovering files...
Checking for syntax errors: file:///home/testuser/code/cpython/Modules/_pickle.c
  Processing folder (recursive): /usr/lib/gcc/x86_64-linux-gnu/5/include/
  Processing folder (recursive): /usr/local/include/
  Processing folder (recursive): /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/
  Processing folder (recursive): /usr/include/
  Processing folder (recursive): /home/testuser/code/cpython/
  Indexing: 8689 file(s) processed
  Indexing: 0 file(s) removed from database
Done discovering files.
Parsing open files...
Done parsing open files.
Checking for edits and parsing remaining files...
  Processing folder (recursive): /home/testuser/code/cpython/
  Parsing: 4283 files(s) processed
Done parsing remaining files.
Language Service bug parser performance

All 6 comments

Thank you for the report. I am able to duplicate this. The IntelliSense process is stuck in an infinite loop and the Extension process is waiting for the IntelliSense process to respond to a shutdown request (which it won't because it's stuck).

That said, I was able to get it working by adding "__GNUC__=5" and "Py_BUILD_CORE" to the "defines" array and "${workspaceRoot}/Include" to the "includePath" in c_cpp_properties.json.

I confirm that this workaround works for me as well.

I have the same issue but the suggested workaround did not work.

Well, even if this workaround works for this particular code it does not work for my code project.

Is there any other ways to make intellisense from taking 100% cpu for each opened file (each creates its own thread) that totally hangs the operting system ( 4.15.1-2-ARCH # 1 SMP x86_64 GNU/Linux)

The only solution for me and my team-mates was to do run it with 'nice 20 code'. At least I am able to move my mouse when this happens.

@0x00deaf You can set the intelliSenseEngine to "Tag Parser" to disable the IntelliSense process until we can get the infinite processing fixed. 0.16.0 is going to add a compilerPath option and set the compiler defines correctly (and maybe a language version option) which may fix the issue if it's caused by incorrect flags/defines being passed to our parser. But if it's still not fixed, we may need to find a repro or get a call stack.

This appears to have been addressed. Using the repo steps, I see the IntelliSense process complete an initial pass and settle down quickly. On close, everything shuts down.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

narutse picture narutse  路  3Comments

chrisckc picture chrisckc  路  3Comments

jrieken picture jrieken  路  3Comments

SkyRiderMike picture SkyRiderMike  路  3Comments

montery8 picture montery8  路  3Comments