microsoft / microsoft/vscode-cpptools
Language server crashed
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 6.2k
- Fork
- 1.7k
- Merge medio
- 14h 46m
- PR unite (30g)
- 61
Descrizione
Environment
- OS and Version: Windows 10, Ubuntu 22.04, WSL 1.2.5 / 2.0.9
- VS Code Version: 1.84.2
- C/C++ Extension Version: Tested with 1.18.5 && 1.19.1
- If using SSH remote, specify OS of remote machine:
Bug Summary and Steps to Reproduce
Bug Summary:
Creating this issue from #10651 discussion.
Company project, private code, complex & huge C++ one.
We get Language Server Crashed. Restarting... in different machines and developers so frequently. This error is easily triggered if we try to execute Show Call Hierarchy, for example, or just hovering in a method name and wait 2-5 minutes. Sometimes we have found that even without doing anything besides opening a file could happen, but not really sure about this last one.
Removing or renaming the c_cpp_properties & reopening the project seems to avoid crashing so easily & frequently.
The file compile_commands.json are huge for all projects in my division: 48MB && ~83000 lines
This file size could trigger other issues, for example is crashing another projects when trying to configure with CMake Tools Extension Issue 3469
- Snapshot of things working decently (but some submodules or nested folders seems not working, will be back to this)
Steps to reproduce:
- Snapshot triggering the issue with just hovering in the same function with the c_cpp_properties.json below. In weird ocassions it does not fail, just takes about ~10 minutes and the log shows parsings the files:
Processing folder recursive
Tag parsing file...
Expected behavior:
- Language Server works.
- C/C++ development experience for production & real world projects is neat.
Configuration and Logs
{
"name": "Linux",
"includePath": [
"${default}"
],
"defines": [],
"compilerPath": "/usr/bin/g++",
"cStandard": "c17",
"cppStandard": "c++14",
"intelliSenseMode": "linux-gcc-x64",
"compileCommands": "${workspaceFolder}/build/Debug/compile_commands.json",
"configurationProvider": "ms-vscode.cmake-tools"
}
Enabling output logging to Debug seems to not showing anything meaningful:
"C_Cpp.loggingLevel": "Debug",
loggingLevel: Debug
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.19.1
cpptools version (native): 1.19.1.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: (received) cpptools/didChangeCppProperties (id: 2)
LSP: (invoked) cpptools/didChangeCppProperties (id: 2)
LSP: (received) cpptools/queryCompilerDefaults (id: 3)
Code browsing service initialized
Querying compiler for default C++ language standard using command line: /usr/bin/g++ -x c++ -E -dM /dev/null
Detected language standard version: gnu++17
Querying compiler's default target using command line: "/usr/bin/g++" -dumpmachine
Compiler returned default target value: x86_64-linux-gnu
Compiler query command line: /usr/bin/g++ -std=c++14 -m64 -Wp,-v -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/g++'
Compiler query command line: /usr/bin/g++ -std=c17 -m64 -Wp,-v -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/g++'
LSP: (received - deferred) cpptools/fileCreated: file:///home/borjamf/workspace/project/.git/modules/external/grpc/lfs/tmp/4015002588
LSP: (received - deferred) cpptools/fileDeleted: file:///home/borjamf/workspace/project/.git/modules/external/grpc/lfs/tmp/4015002588
LSP: (received - deferred) cpptools/fileCreated: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/775123808
LSP: (received - deferred) cpptools/fileCreated: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/4188040991
LSP: (received - deferred) cpptools/fileDeleted: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/775123808
LSP: (received - deferred) cpptools/fileCreated: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/4213759766
LSP: (received - deferred) cpptools/fileDeleted: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/4188040991
LSP: (received - deferred) cpptools/fileCreated: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/1524892023
LSP: (received - deferred) cpptools/fileDeleted: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/4213759766
LSP: (received - deferred) cpptools/fileCreated: file:///home/borjamf/workspace/project/.git/modules/external/grpc/lfs/tmp/3710730601
LSP: (received - deferred) cpptools/fileDeleted: file:///home/borjamf/workspace/project/.git/modules/external/grpc/lfs/tmp/3710730601
LSP: (received - deferred) cpptools/fileDeleted: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/1524892023
LSP: (received - deferred) cpptools/fileCreated: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/3147052370
LSP: (received - deferred) cpptools/fileCreated: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/1837593162
LSP: (received - deferred) cpptools/fileDeleted: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/3147052370
LSP: (received - deferred) cpptools/fileDeleted: file:///home/borjamf/workspace/project/.git/modules/.pro/local_pro/lfs/tmp/1837593162/1837593162
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.19.1
cpptools version (native): 1.19.1.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: (received) cpptools/didChangeCppProperties (id: 2)
LSP: (invoked) cpptools/didChangeCppProperties (id: 2)
LSP: (received) cpptools/queryCompilerDefaults (id: 3)
Code browsing service initialized
Querying compiler for default C++ language standard using command line: /usr/bin/g++ -x c++ -E -dM /dev/null
Detected language standard version: gnu++17
Querying compiler's default target using command line: "/usr/bin/g++" -dumpmachine
Compiler returned default target value: x86_64-linux-gnu
Compiler query command line: /usr/bin/g++ -std=c++14 -m64 -Wp,-v -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/g++'
Compiler query command line: /usr/bin/g++ -std=c17 -m64 -Wp,-v -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/g++'
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.19.1
cpptools version (native): 1.19.1.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: (received) cpptools/didChangeCppProperties (id: 2)
LSP: (received) cpptools/queryCompilerDefaults (id: 3)
LSP: (invoked) cpptools/didChangeCppProperties (id: 2)
Code browsing service initialized
Querying compiler for default C++ language standard using command line: /usr/bin/g++ -x c++ -E -dM /dev/null
Detected language standard version: gnu++17
Querying compiler's default target using command line: "/usr/bin/g++" -dumpmachine
Compiler returned default target value: x86_64-linux-gnu
Compiler query command line: /usr/bin/g++ -std=c++14 -m64 -Wp,-v -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/g++'
Compiler query command line: /usr/bin/g++ -std=c17 -m64 -Wp,-v -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/g++'
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.19.1
cpptools version (native): 1.19.1.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: (received) cpptools/didChangeCppProperties (id: 2)
LSP: (received) cpptools/queryCompilerDefaults (id: 3)
LSP: (invoked) cpptools/didChangeCppProperties (id: 2)
Code browsing service initialized
Querying compiler for default C++ language standard using command line: /usr/bin/g++ -x c++ -E -dM /dev/null
Detected language standard version: gnu++17
Querying compiler's default target using command line: "/usr/bin/g++" -dumpmachine
Compiler returned default target value: x86_64-linux-gnu
Compiler query command line: /usr/bin/g++ -std=c++14 -m64 -Wp,-v -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/g++'
Compiler query command line: /usr/bin/g++ -std=c17 -m64 -Wp,-v -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/g++'
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.19.1
cpptools version (native): 1.19.1.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: (received) cpptools/didChangeCppProperties (id: 2)
LSP: (received) cpptools/queryCompilerDefaults (id: 3)
LSP: (invoked) cpptools/didChangeCppProperties (id: 2)
Code browsing service initialized
Querying compiler for default C++ language standard using command line: /usr/bin/g++ -x c++ -E -dM /dev/null
Detected language standard version: gnu++17
Querying compiler's default target using command line: "/usr/bin/g++" -dumpmachine
Compiler returned default target value: x86_64-linux-gnu
Compiler query command line: /usr/bin/g++ -std=c++14 -m64 -Wp,-v -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/g++'
Compiler query command line: /usr/bin/g++ -std=c17 -m64 -Wp,-v -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/g++'
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.19.1
cpptools version (native): 1.19.1.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: (received) cpptools/didChangeCppProperties (id: 2)
LSP: (received) cpptools/queryCompilerDefaults (id: 3)
LSP: (invoked) cpptools/didChangeCppProperties (id: 2)
Code browsing service initialized
Querying compiler for default C++ language standard using command line: /usr/bin/g++ -x c++ -E -dM /dev/null
Detected language standard version: gnu++17
Querying compiler's default target using command line: "/usr/bin/g++" -dumpmachine
Compiler returned default target value: x86_64-linux-gnu
Compiler query command line: /usr/bin/g++ -std=c++14 -m64 -Wp,-v -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/g++'
Compiler query command line: /usr/bin/g++ -std=c17 -m64 -Wp,-v -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/g++'
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.19.1
cpptools version (native): 1.19.1.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: (received) cpptools/didChangeCppProperties (id: 2)
LSP: (received) cpptools/queryCompilerDefaults (id: 3)
LSP: (invoked) cpptools/didChangeCppProperties (id: 2)
Code browsing service initialized
Querying compiler for default C++ language standard using command line: /usr/bin/g++ -x c++ -E -dM /dev/null
Detected language standard version: gnu++17
Querying compiler's default target using command line: "/usr/bin/g++" -dumpmachine
Compiler returned default target value: x86_64-linux-gnu
Compiler query command line: /usr/bin/g++ -std=c++14 -m64 -Wp,-v -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/g++'
Compiler query command line: /usr/bin/g++ -std=c17 -m64 -Wp,-v -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/g++'
LSP: (received) cpptools/initialize (id: 1)
LSP: (invoked) cpptools/initialize (id: 1)
cpptools version (TypeScript): 1.19.1
cpptools version (native): 1.19.1.0
Autocomplete is enabled.
Error squiggles are enabled if all header dependencies are resolved.
Hover is enabled.
IntelliSense Engine = default.
LSP: (received) cpptools/didChangeCppProperties (id: 2)
LSP: (received) cpptools/queryCompilerDefaults (id: 3)
LSP: (invoked) cpptools/didChangeCppProperties (id: 2)
Code browsing service initialized
Querying compiler for default C++ language standard using command line: /usr/bin/g++ -x c++ -E -dM /dev/null
Detected language standard version: gnu++17
Querying compiler's default target using command line: "/usr/bin/g++" -dumpmachine
Compiler returned default target value: x86_64-linux-gnu
Compiler query command line: /usr/bin/g++ -std=c++14 -m64 -Wp,-v -E -dM -x c++ /dev/null
Attempting to get defaults from C++ compiler in "compilerPath" property: '/usr/bin/g++'
Compiler query command line: /usr/bin/g++ -std=c17 -m64 -Wp,-v -E -dM -x c /dev/null
Attempting to get defaults from C compiler in "compilerPath" property: '/usr/bin/g++'
Other Extensions
No response
Additional context
Cannot reproduce the crash when attaching. It does not stop anywhere, but the extension or process is killed.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con la configurazione c_cpp_properties.json segnalata, il compile_commands.json da 48MB e l’output di Debug durante la riproduzione di Show Call Hierarchy o dell’elaborazione attivata dall’hover. Il lavoro è completato quando il server del linguaggio non va più in crash né si blocca sul progetto segnalato, e i log identificano il problema rilevante se il problema persiste.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp, typescript, vscode
- Ambito
- developer-experience, tooling
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100