Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes on C++20 when starting to type a word. #202

Closed
shinjitumala opened this issue Jun 28, 2021 · 2 comments
Closed

Crashes on C++20 when starting to type a word. #202

shinjitumala opened this issue Jun 28, 2021 · 2 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@shinjitumala
Copy link

shinjitumala commented Jun 28, 2021

Clangd is frequently crashing as soon as I type anything in the editor.
It happens on projects where I'm using C++20, using stuff only implemented in GCC.
Sometimes it does not crash if I restart clangd while typing a word, which suggests that it's not really a fundamental limitation of clangd but a but perhaps?

Logs

I[16:02:36.279] <-- textDocument/codeAction(12)
I[16:02:36.279] --> reply:textDocument/codeAction(12) 0 ms
I[16:02:36.279] --> textDocument/clangd.fileStatus
I[16:02:37.894] <-- textDocument/didChange
I[16:02:37.894] --> textDocument/clangd.fileStatus
I[16:02:37.946] ASTWorker building file /home/shinjihoshino/Projects/SWORD/src/sword/sa/slice/Slicer.hpp version 113 with command inferred from /home/shinjihoshino/TiTech/2021/SWORD/src/main.cpp
[/home/shinjihoshino/TiTech/2021/SWORD/build]
/usr/bin/g++ --driver-mode=g++ -I/home/shinjihoshino/TiTech/2021/SWORD/src -I/home/shinjihoshino/TiTech/2021/SWORD/submodules/abseil-cpp -g -fno-rtti -fno-exceptions -Wall -g3 -c -std=gnu++20 /home/shinjihoshino/Projects/SWORD/src/sword/sa/slice/Slicer.hpp -fsyntax-only -resource-dir=/usr/lib/clang/12.0.0
I[16:02:37.947] --> textDocument/clangd.fileStatus
I[16:02:37.947] --> textDocument/clangd.fileStatus
I[16:02:38.882] <-- textDocument/documentLink(13)
I[16:02:38.882] --> textDocument/clangd.fileStatus
I[16:02:38.923] --> reply:textDocument/documentLink(13) 40 ms
I[16:02:38.923] --> textDocument/clangd.fileStatus
I[16:02:39.871] <-- textDocument/didChange
I[16:02:39.872] --> textDocument/clangd.fileStatus
I[16:02:39.872] <-- textDocument/documentHighlight(14)
I[16:02:39.872] --> textDocument/clangd.fileStatus
I[16:02:39.874] ASTWorker building file /home/shinjihoshino/Projects/SWORD/src/sword/sa/slice/Slicer.hpp version 114 with command inferred from /home/shinjihoshino/TiTech/2021/SWORD/src/main.cpp
[/home/shinjihoshino/TiTech/2021/SWORD/build]
/usr/bin/g++ --driver-mode=g++ -I/home/shinjihoshino/TiTech/2021/SWORD/src -I/home/shinjihoshino/TiTech/2021/SWORD/submodules/abseil-cpp -g -fno-rtti -fno-exceptions -Wall -g3 -c -std=gnu++20 /home/shinjihoshino/Projects/SWORD/src/sword/sa/slice/Slicer.hpp -fsyntax-only -resource-dir=/usr/lib/clang/12.0.0
I[16:02:39.874] --> textDocument/clangd.fileStatus
I[16:02:39.885] <-- textDocument/completion(15)
I[16:02:39.915] --> reply:textDocument/documentHighlight(14) 43 ms
I[16:02:39.915] --> textDocument/clangd.fileStatus
 #0 0x00007fb81e422643 (/usr/bin/../lib/libLLVM-12.so+0xb48643)
 #1 0x00007fb81e41fd46 (/usr/bin/../lib/libLLVM-12.so+0xb45d46)
 #2 0x00007fb826fc5870 __restore_rt (/usr/bin/../lib/libpthread.so.0+0x13870)
 #3 0x00007fb8250c7957 (/usr/bin/../lib/libclang-cpp.so.12+0x1553957)
 #4 0x00007fb8250ca058 (/usr/bin/../lib/libclang-cpp.so.12+0x1556058)
 #5 0x00007fb8250c9853 (/usr/bin/../lib/libclang-cpp.so.12+0x1555853)
 #6 0x00007fb8250c9853 (/usr/bin/../lib/libclang-cpp.so.12+0x1555853)
 #7 0x00007fb8250c9853 (/usr/bin/../lib/libclang-cpp.so.12+0x1555853)
 #8 0x00007fb8250c9853 (/usr/bin/../lib/libclang-cpp.so.12+0x1555853)
 #9 0x00007fb8250c9853 (/usr/bin/../lib/libclang-cpp.so.12+0x1555853)
#10 0x00007fb8250c9853 (/usr/bin/../lib/libclang-cpp.so.12+0x1555853)
#11 0x00007fb8250c9853 (/usr/bin/../lib/libclang-cpp.so.12+0x1555853)
#12 0x00007fb8250c9853 (/usr/bin/../lib/libclang-cpp.so.12+0x1555853)
#13 0x00007fb8250c9853 (/usr/bin/../lib/libclang-cpp.so.12+0x1555853)
#14 0x00007fb8250ca820 clang::Sema::LookupVisibleDecls(clang::Scope*, clang::Sema::LookupNameKind, clang::VisibleDeclConsumer&, bool, bool) (/usr/bin/../lib/libclang-cpp.so.12+0x1556820)
#15 0x00007fb824cea880 clang::Sema::CodeCompleteOrdinaryName(clang::Scope*, clang::Sema::ParserCompletionContext) (/usr/bin/../lib/libclang-cpp.so.12+0x1176880)
#16 0x00007fb824560573 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&) (/usr/bin/../lib/libclang-cpp.so.12+0x9ec573)
#17 0x00007fb824561458 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/usr/bin/../lib/libclang-cpp.so.12+0x9ed458)
#18 0x00007fb8245621fa clang::Parser::ParseCompoundStatementBody(bool) (/usr/bin/../lib/libclang-cpp.so.12+0x9ee1fa)
#19 0x00007fb824562c9c clang::Parser::ParseCompoundStatement(bool, unsigned int) (/usr/bin/../lib/libclang-cpp.so.12+0x9eec9c)
#20 0x00007fb824560527 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&) (/usr/bin/../lib/libclang-cpp.so.12+0x9ec527)
#21 0x00007fb824561458 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/usr/bin/../lib/libclang-cpp.so.12+0x9ed458)
#22 0x00007fb824566632 clang::Parser::ParseStatement(clang::SourceLocation*, clang::Parser::ParsedStmtContext) (/usr/bin/../lib/libclang-cpp.so.12+0x9f2632)
#23 0x00007fb824569a4f clang::Parser::ParseIfStatement(clang::SourceLocation*) (/usr/bin/../lib/libclang-cpp.so.12+0x9f5a4f)
#24 0x00007fb824560c60 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&) (/usr/bin/../lib/libclang-cpp.so.12+0x9ecc60)
#25 0x00007fb824561458 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/usr/bin/../lib/libclang-cpp.so.12+0x9ed458)
#26 0x00007fb8245621fa clang::Parser::ParseCompoundStatementBody(bool) (/usr/bin/../lib/libclang-cpp.so.12+0x9ee1fa)
#27 0x00007fb824562c9c clang::Parser::ParseCompoundStatement(bool, unsigned int) (/usr/bin/../lib/libclang-cpp.so.12+0x9eec9c)
#28 0x00007fb824560527 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&) (/usr/bin/../lib/libclang-cpp.so.12+0x9ec527)
#29 0x00007fb824561458 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/usr/bin/../lib/libclang-cpp.so.12+0x9ed458)
#30 0x00007fb824566632 clang::Parser::ParseStatement(clang::SourceLocation*, clang::Parser::ParsedStmtContext) (/usr/bin/../lib/libclang-cpp.so.12+0x9f2632)
#31 0x00007fb824566bac clang::Parser::ParseForStatement(clang::SourceLocation*) (/usr/bin/../lib/libclang-cpp.so.12+0x9f2bac)
#32 0x00007fb824560c87 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&) (/usr/bin/../lib/libclang-cpp.so.12+0x9ecc87)
#33 0x00007fb824561458 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/usr/bin/../lib/libclang-cpp.so.12+0x9ed458)
#34 0x00007fb8245621fa clang::Parser::ParseCompoundStatementBody(bool) (/usr/bin/../lib/libclang-cpp.so.12+0x9ee1fa)
#35 0x00007fb824564deb clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/usr/bin/../lib/libclang-cpp.so.12+0x9f0deb)
#36 0x00007fb82459762a clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/usr/bin/../lib/libclang-cpp.so.12+0xa2362a)
#37 0x00007fb8244d42d1 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/usr/bin/../lib/libclang-cpp.so.12+0x9602d1)
#38 0x00007fb8245931d5 (/usr/bin/../lib/libclang-cpp.so.12+0xa1f1d5)
#39 0x00007fb82459989e clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/usr/bin/../lib/libclang-cpp.so.12+0xa2589e)
#40 0x00007fb8244ea505 clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (/usr/bin/../lib/libclang-cpp.so.12+0x976505)
#41 0x00007fb8244ea452 clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (/usr/bin/../lib/libclang-cpp.so.12+0x976452)
#42 0x00007fb8244f1c63 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) (/usr/bin/../lib/libclang-cpp.so.12+0x97dc63)
#43 0x00007fb8244d50ce clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, clang::SourceLocation*) (/usr/bin/../lib/libclang-cpp.so.12+0x9610ce)
#44 0x00007fb824599435 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/usr/bin/../lib/libclang-cpp.so.12+0xa25435)
#45 0x00007fb8244ea505 clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (/usr/bin/../lib/libclang-cpp.so.12+0x976505)
#46 0x00007fb8244f1c63 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) (/usr/bin/../lib/libclang-cpp.so.12+0x97dc63)
#47 0x00007fb8244d50ce clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, clang::SourceLocation*) (/usr/bin/../lib/libclang-cpp.so.12+0x9610ce)
#48 0x00007fb824599435 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/usr/bin/../lib/libclang-cpp.so.12+0xa25435)
#49 0x00007fb8244ea505 clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (/usr/bin/../lib/libclang-cpp.so.12+0x976505)
#50 0x00007fb8244f1c63 clang::Parser::ParseNamespace(clang::DeclaratorContext, clang::SourceLocation&, clang::SourceLocation) (/usr/bin/../lib/libclang-cpp.so.12+0x97dc63)
#51 0x00007fb8244d50ce clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAt[Info  - 4:02:51 PM] Connection to server got closed. Server will restart.
[Error - 4:02:51 PM] Request textDocument/completion failed.
[object Object]
[Error - 4:02:51 PM] Request textDocument/codeAction failed.
[object Object]
[Error - 4:02:51 PM] Request textDocument/documentHighlight failed.
[object Object]
[Error - 4:02:51 PM] Request textDocument/codeAction failed.
[object Object]
[Error - 4:02:51 PM] Request textDocument/documentLink failed.
[object Object]
[Error - 4:02:51 PM] Request textDocument/documentHighlight failed.
[object Object]
[Error - 4:02:51 PM] Request textDocument/codeAction failed.
[object Object]
[Error - 4:02:51 PM] Request textDocument/documentHighlight failed.
[object Object]
[Error - 4:02:51 PM] Request textDocument/codeAction failed.
[object Object]
[Error - 4:02:51 PM] Request textDocument/documentHighlight failed.
[object Object]
[Error - 4:02:51 PM] Request textDocument/documentLink failed.
[object Object]
[Error - 4:02:51 PM] Request textDocument/documentHighlight failed.
[object Object]
[Error - 4:02:51 PM] Request textDocument/documentHighlight failed.
[object Object]
[Error - 4:02:51 PM] Request textDocument/documentHighlight failed.
[object Object]
[Error - 4:02:51 PM] Request textDocument/codeAction failed.
[object Object]
[Error - 4:02:51 PM] Request textDocument/completion failed.
[object Object]
[Error - 4:02:51 PM] Request textDocument/completion failed.
[object Object]
[Error - 4:02:51 PM] Request textDocument/documentLink failed.
[object Object]
[Error - 4:02:51 PM] Request textDocument/codeAction failed.
[object Object]
[Error - 4:02:51 PM] Request textDocument/codeAction failed.
[object Object]
[Error - 4:02:51 PM] Request textDocument/completion failed.
[object Object]
[Error - 4:02:51 PM] Request textDocument/codeAction failed.
[object Object]
[Error - 4:02:51 PM] Request textDocument/documentLink failed.
[object Object]

System information
Clangd version (from the log, or clangd --version): ~ $ clangd version 12.0.0
clangd extension version: v0.1.11
Operating system: Arch Linux

@shinjitumala shinjitumala added the bug Something isn't working label Jun 28, 2021
@kadircet
Copy link
Member

kadircet commented Jul 6, 2021

see clangd/clangd#771

@kadircet kadircet closed this as completed Jul 6, 2021
@kadircet kadircet added the duplicate This issue or pull request already exists label Jul 6, 2021
@shinjitumala
Copy link
Author

Nice. Thanks for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants