Skip to content

Instantly share code, notes, and snippets.

@bstaletic
Last active July 13, 2020 05:43
Show Gist options
  • Save bstaletic/9bbed8dbbeb9d390e526d8ff591b8d3a to your computer and use it in GitHub Desktop.
Save bstaletic/9bbed8dbbeb9d390e526d8ff591b8d3a to your computer and use it in GitHub Desktop.
clangd crash when encountering std::ranges
I[07:42:31.299] clangd version 10.0.0
I[07:42:31.299] PID: 16868
I[07:42:31.299] Working directory: /home/bstaletic/work/NanoRange
I[07:42:31.299] argv[0]: /usr/sbin/clangd
I[07:42:31.299] argv[1]: -background-index=0
I[07:42:31.299] argv[2]: -clang-tidy=0
I[07:42:31.299] argv[3]: -header-insertion-decorators=0
I[07:42:31.299] argv[4]: -limit-results=500
I[07:42:31.299] argv[5]: -log=verbose
I[07:42:31.299] Starting LSP over stdin/stdout
V[07:42:31.299] <<< {"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"experimental":{"statusNotification":true},"textDocument":{"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"completion":{"completionItem":{"documentationFormat":["plaintext","markdown"]},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"contentFormat":["plaintext","markdown"]},"signatureHelp":{"signatureInformation":{"documentationFormat":["plaintext","markdown"],"parameterInformation":{"labelOffsetSupport":false}}},"synchronization":{"didSave":true}},"workspace":{"applyEdit":true,"didChangeWatchedFiles":{"dynamicRegistration":true},"documentChanges":true,"symbol":{"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}}}},"initializationOptions":{},"processId":16822,"rootPath":"/home/bstaletic/work/NanoRange","rootUri":"file:///home/bstaletic/work/NanoRange"}}
I[07:42:31.299] <-- initialize(1)
I[07:42:31.299] --> reply:initialize(1) 0 ms
V[07:42:31.299] >>> {"id":1,"jsonrpc":"2.0","result":{"capabilities":{"codeActionProvider":{"codeActionKinds":["quickfix","refactor","info"]},"completionProvider":{"resolveProvider":false,"triggerCharacters":[".",">",":"]},"declarationProvider":true,"definitionProvider":true,"documentFormattingProvider":true,"documentHighlightProvider":true,"documentLinkProvider":{"resolveProvider":false},"documentOnTypeFormattingProvider":{"firstTriggerCharacter":"\n","moreTriggerCharacter":[]},"documentRangeFormattingProvider":true,"documentSymbolProvider":true,"executeCommandProvider":{"commands":["clangd.applyFix","clangd.applyTweak"]},"hoverProvider":true,"referencesProvider":true,"renameProvider":true,"selectionRangeProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",","]},"textDocumentSync":2,"typeHierarchyProvider":true,"workspaceSymbolProvider":true}}}
V[07:42:31.301] <<< {"jsonrpc":"2.0","method":"initialized","params":{}}
I[07:42:31.301] <-- initialized
I[07:42:31.301] unhandled notification initialized
V[07:42:31.301] <<< {"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{}}}
I[07:42:31.301] <-- workspace/didChangeConfiguration
V[07:42:31.303] <<< {"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"compilationDatabaseChanges":{"/home/bstaletic/work/NanoRange/foo.cpp":{"compilationCommand":["clang-tool","-std=c++20","/home/bstaletic/work/NanoRange/foo.cpp"],"workingDirectory":"/home/bstaletic/work/NanoRange"}}}}}
I[07:42:31.303] <-- workspace/didChangeConfiguration
I[07:42:31.303] Failed to find compilation database for /home/bstaletic/work/NanoRange/foo.cpp
V[07:42:31.303] <<< {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"cpp","text":"#include <ranges>\n\nint main(void)\n{\n\tstd::ranges::subrange({\n}\n","uri":"file:///home/bstaletic/work/NanoRange/foo.cpp","version":1}}}
I[07:42:31.303] <-- textDocument/didOpen
I[07:42:31.303] Updating file /home/bstaletic/work/NanoRange/foo.cpp with command
[/home/bstaletic/work/NanoRange]
clang-tool -std=c++20 /home/bstaletic/work/NanoRange/foo.cpp -fsyntax-only -resource-dir=/usr/lib/clang/10.0.0
V[07:42:31.307] Driver produced command: cc1 -cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -disable-free -disable-llvm-verifier -discard-value-names -main-file-name foo.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mthread-model posix -mframe-pointer=all -fmath-errno -fno-rounding-math -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining -debugger-tuning=gdb -resource-dir /usr/lib/clang/10.0.0 -internal-isystem /../lib64/gcc/x86_64-pc-linux-gnu/10.1.0/../../../../include/c++/10.1.0 -internal-isystem /../lib64/gcc/x86_64-pc-linux-gnu/10.1.0/../../../../include/c++/10.1.0/x86_64-pc-linux-gnu -internal-isystem /../lib64/gcc/x86_64-pc-linux-gnu/10.1.0/../../../../include/c++/10.1.0/backward -internal-isystem /usr/local/include -internal-isystem /usr/lib/clang/10.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -std=c++20 -fdeprecated-macro -fdebug-compilation-dir /home/bstaletic/work/NanoRange -ferror-limit 19 -fmessage-length 0 -stack-protector 2 -fgnuc-version=4.2.1 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -faddrsig -x c++ /home/bstaletic/work/NanoRange/foo.cpp
V[07:42:31.307] Building first preamble for /home/bstaletic/work/NanoRange/foo.cpp
V[07:42:32.241] index AST for /home/bstaletic/work/NanoRange/foo.cpp (main=false):
symbol slab: 9116 symbols, 2704864 bytes
ref slab: 0 symbols, 0 refs, 136 bytes
relations slab: 498 relations, 17432 bytes
V[07:42:32.328] Built preamble of size 5718800 for file /home/bstaletic/work/NanoRange/foo.cpp
#0 0x00007f9084b2677b llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/bin/../lib/libLLVM-10.so+0x9e377b)
#1 0x00007f9084b242d4 llvm::sys::RunSignalHandlers() (/usr/bin/../lib/libLLVM-10.so+0x9e12d4)
#2 0x00007f9084b24429 (/usr/bin/../lib/libLLVM-10.so+0x9e1429)
#3 0x00007f908c47b960 __restore_rt (/usr/bin/../lib/libpthread.so.0+0x14960)
#4 0x00007f9089bd243d clang::driver::ToolChain::buildLinker() const (/usr/bin/../lib/libclang-cpp.so.10+0x69443d)
#5 0x00007f908b3fa64e (/usr/bin/../lib/libclang-cpp.so.10+0x1ebc64e)
#6 0x00007f908b429425 clang::ASTDeclReader::findExisting(clang::NamedDecl*) (/usr/bin/../lib/libclang-cpp.so.10+0x1eeb425)
#7 0x00007f908b4368aa clang::ASTDeclReader::VisitRedeclarableTemplateDecl(clang::RedeclarableTemplateDecl*) (/usr/bin/../lib/libclang-cpp.so.10+0x1ef88aa)
#8 0x00007f908b4377c0 clang::ASTDeclReader::VisitFunctionTemplateDecl(clang::FunctionTemplateDecl*) (/usr/bin/../lib/libclang-cpp.so.10+0x1ef97c0)
#9 0x00007f908b438302 clang::ASTDeclReader::Visit(clang::Decl*) (/usr/bin/../lib/libclang-cpp.so.10+0x1efa302)
#10 0x00007f908b438eae clang::ASTReader::ReadDeclRecord(unsigned int) (/usr/bin/../lib/libclang-cpp.so.10+0x1efaeae)
#11 0x00007f908b3bfa3a clang::ASTReader::GetDecl(unsigned int) (/usr/bin/../lib/libclang-cpp.so.10+0x1e81a3a)
#12 0x00007f908b3f5206 clang::ASTReader::FindExternalVisibleDeclsByName(clang::DeclContext const*, clang::DeclarationName) (/usr/bin/../lib/libclang-cpp.so.10+0x1eb7206)
#13 0x00007f9089f854b0 clang::DeclContext::lookup(clang::DeclarationName) const (/usr/bin/../lib/libclang-cpp.so.10+0xa474b0)
#14 0x00007f908a9dbb93 clang::Sema::DeclareImplicitDeductionGuides(clang::TemplateDecl*, clang::SourceLocation) (/usr/bin/../lib/libclang-cpp.so.10+0x149db93)
#15 0x00007f908a835809 (/usr/bin/../lib/libclang-cpp.so.10+0x12f7809)
#16 0x00007f908a835e1d clang::Sema::LookupQualifiedName(clang::LookupResult&, clang::DeclContext*, bool) (/usr/bin/../lib/libclang-cpp.so.10+0x12f7e1d)
#17 0x00007f908a7e96be clang::Sema::DeduceTemplateSpecializationFromInitializer(clang::TypeSourceInfo*, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>) (/usr/bin/../lib/libclang-cpp.so.10+0x12ab6be)
#18 0x00007f908a74a2da clang::Sema::BuildCXXTypeConstructExpr(clang::TypeSourceInfo*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, bool) (/usr/bin/../lib/libclang-cpp.so.10+0x120c2da)
#19 0x00007f908a7844e0 clang::Sema::ActOnCXXTypeConstructExpr(clang::OpaquePtr<clang::QualType>, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, bool) (/usr/bin/../lib/libclang-cpp.so.10+0x12464e0)
#20 0x00007f9089d9a67c clang::Parser::ParseCXXTypeConstructExpression(clang::DeclSpec const&) (/usr/bin/../lib/libclang-cpp.so.10+0x85c67c)
#21 0x00007f9089d85b93 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) (/usr/bin/../lib/libclang-cpp.so.10+0x847b93)
#22 0x00007f9089d872b8 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, clang::Parser::TypeCastState, bool, bool*) (/usr/bin/../lib/libclang-cpp.so.10+0x8492b8)
#23 0x00007f9089d89326 clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) (/usr/bin/../lib/libclang-cpp.so.10+0x84b326)
#24 0x00007f9089d89f3a clang::Parser::ParseExpression(clang::Parser::TypeCastState) (/usr/bin/../lib/libclang-cpp.so.10+0x84bf3a)
#25 0x00007f9089de0b7e clang::Parser::ParseExprStatement(clang::Parser::ParsedStmtContext) (/usr/bin/../lib/libclang-cpp.so.10+0x8a2b7e)
#26 0x00007f9089dde874 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&) (/usr/bin/../lib/libclang-cpp.so.10+0x8a0874)
#27 0x00007f9089ddfd6e clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/usr/bin/../lib/libclang-cpp.so.10+0x8a1d6e)
#28 0x00007f9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment