microsoft / microsoft/vscode-cpptools

macOS: High CPU Usage (looping `update_file_if_needed`)

Abierto
#8,124 3 comentarios 3 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

bug Language Service performance symlinks
Lenguaje dominante
TypeScript
Estrellas
6.2k
Forks
1.7k
Merge medio
14 h 46 min
PR fusionados (30 d)
61

Descripción

Bug type: Language Service

Describe the bug

  • OS and Version:
    Screen Shot 2021-09-09 at 11 00 41 am
  • VS Code Version:
    Screen Shot 2021-09-09 at 11 00 56 am
  • C/C++ Extension Version:
    v1.6.0

Sometime after starting vscode, the cpptools process will jump to 100% CPU usage and stay there until the windows is reloaded.
The project is for embedded devices, and is therefore using a cross-compiler (arm-none-eabi-gcc). Intellisense configuration is through an autogenerated compile_commands.json. The project is based on Zephyr RTOS (https://github.com/zephyrproject-rtos/zephyr). The root folder (ignoring compiler headers) is approximately 40k files.

Code sample and logs

  • Configurations in c_cpp_properties.json
{
    "configurations": [
        {
            "name": "Zephyr",
            "cStandard": "c99",
            "compilerPath": "/Users/<user>/code/gcc-arm-none-eabi/bin/arm-none-eabi-gcc",
            "intelliSenseMode": "gcc-x64",
            "compileCommands": "${workspaceFolder}/build/compile_commands.json",
            "includePath": [
                "zephyr/include",
                "${workspaceFolder}/build/zephyr/include/generated"
            ]
        }
    ],
    "version": 4
}
  • Logs from running C/C++: Log Diagnostics from the VS Code command palette
    "C_Cpp.loggingLevel": "7",
update_file_if_needed: /Users/<user>/zephyr/zephyr/include/arch/x86/arch.h
  Same time stamp: 1630475297
update_file_if_needed: /Users/<user>/zephyr/zephyr/include/arch/arm64/arch.h
  Same time stamp: 1630475297
update_file_if_needed: /Users/<user>/zephyr/zephyr/include/arch/arm/aarch32/arch.h
  Same time stamp: 1630475297
update_file_if_needed: /Users/<user>/zephyr/zephyr/include/arch/arc/arch.h
  Same time stamp: 1630475297
update_file_if_needed: /Users/<user>/zephyr/zephyr/include/arch/nios2/arch.h
  Same time stamp: 1630475297
update_file_if_needed: /Users/<user>/zephyr/zephyr/include/arch/riscv/arch.h
  Same time stamp: 1630475297
update_file_if_needed: /Users/<user>/zephyr/zephyr/include/arch/xtensa/arch.h
  Same time stamp: 1630475297
update_file_if_needed: /Users/<user>/zephyr/zephyr/include/arch/posix/arch.h
  Same time stamp: 1630475297
update_file_if_needed: /Users/<user>/zephyr/zephyr/include/arch/sparc/arch.h
  Same time stamp: 1630475297

Over a minute or so of just watching the logs, there were approximately 400 thousand lines like the above.
Not all files were being checked. Files that were checked were checked about 80 times each.

Additional context

Call stack of cpptools process.

Screen Shot 2021-09-09 at 11 01 50 am

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con la pila de llamadas del proceso cpptools y los diagnósticos repetidos de update_file_if_needed de C/C++: Log Diagnostics. Reprodúcelo en macOS usando el espacio de trabajo de Zephyr, arm-none-eabi-gcc y compile_commands.json autogenerado; se considera terminado cuando se detienen las comprobaciones repetidas de archivos y cpptools deja de mantener la CPU al 100 %.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
cpp
Área
devtools, performance
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.