clangd icon indicating copy to clipboard operation
clangd copied to clipboard

Crash when using both #include and c++20 modules

Open RichardLuo0 opened this issue 1 year ago • 1 comments

Please describe the problem. I can not find out whats exactly causing the crash. So I create a min reproduction: https://github.com/RichardLuo0/clangd-crash-reproduce, open src/b.cpp, in a few seconds, it will crash. I can successfully compile the project, just clangd keeps crash

Logs

Stack dump:
0.	c:/Users/Richard/Project/Repository/test/src/b.cpp:12:2: current parser token ';'
1.	c:/Users/Richard/Project/Repository/test/src/b.cpp:7:8: parsing struct/union/class body 'B'
Signalled during AST worker action: Build AST
  Filename: C:\Users\Richard\Project\Repository\test\src\b.cpp
  Directory: C:/Users/Richard/Project/Repository/test/build
  Command Line: C:/Development/msys2/clang64/bin/clang++.exe --driver-mode=g++ -g -std=gnu++20 -Wall -x c++-module -fmodule-output=CMakeFiles/test.dir/B.pcm -fmodule-file=A=CMakeFiles/test.dir/A.pcm -o CMakeFiles\test.dir\src\b.cpp.obj -c -resource-dir=C:/Development/msys2/clang64/lib/clang/18 -- c:/Users/Richard/Project/Repository/test/src/b.cpp
  Version: 236
[Error - 21:32:47] The Clang Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
[Error - 21:32:47] Request textDocument/documentSymbol failed.
[object Object]
[Error - 21:32:47] Request textDocument/codeAction failed.
[object Object]
[Error - 21:32:47] Request textDocument/documentLink failed.
[object Object]
[Error - 21:32:47] Request textDocument/inlayHint failed.
[object Object]
[Error - 21:32:47] Request textDocument/documentSymbol failed.
[object Object]
[Error - 21:32:47] Request textDocument/semanticTokens/full failed.
[object Object]

System information

Output of clangd --version: clangd version 18.1.1 Features: windows Platform: x86_64-w64-windows-gnu

Editor/LSP plugin: vscode 1.87.2, llvm-vs-code-extensions.vscode-clangd latest version

Operating system: windows 11

RichardLuo0 avatar Mar 20 '24 13:03 RichardLuo0

Not sure if it will address this crash in particular, but note that clangd support for modules is a work in progress at https://github.com/clangd/clangd/issues/1293.

HighCommander4 avatar Mar 21 '24 07:03 HighCommander4