microsoft / microsoft/vscode-cpptools

macOS: High CPU Usage (looping `update_file_if_needed`)

Aperta
#8,124 3 commenti 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug Language Service performance symlinks
Lingua principale
TypeScript
Stelle
6.2k
Fork
1.7k
Merge medio
14h 46m
PR unite (30g)
61

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con lo stack delle chiamate del processo cpptools e con i diagnostici update_file_if_needed ripetuti di C/C++: Log Diagnostics. Riproduci il problema su macOS usando lo spazio di lavoro Zephyr, arm-none-eabi-gcc e compile_commands.json autogenerato; il lavoro è completato quando i controlli ripetuti dei file si interrompono e cpptools non mantiene più la CPU al 100%.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cpp
Ambito
devtools, performance
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.