Clangd goes down when I work with lsp. However, from clion (it uses a different solution) clangd works stable. What could be the problem? The next stack of Trace falls out, tried reinstalling lsp and clangd, and different versions, the error remains and every 5 minutes of stable operation drops clangd with this log:
I[15:01:48.739] Indexed /home/user-name/Sources/Gui/datamodel/QModel.cpp (523 symbols, 50679 refs, 1972 files)
I[15:01:48.778] --> $/progress
I[15:01:48.779] --> $/progress
I[15:01:49.240] Indexed /home/user-name/main/Sources/Engine/ParserTests.cpp (643 symbols, 59880 refs, 2422 files)
I[15:01:49.287] --> $/progress
I[15:01:49.289] --> $/progress
#0 0x00007f0224d97fda (/usr/lib/libLLVM-13.so+0xb97fda)
#1 0x00007f0224d9565f llvm::sys::RunSignalHandlers() (/usr/lib/libLLVM-13.so+0xb9565f)
#2 0x00007f0224d957ad (/usr/lib/libLLVM-13.so+0xb957ad)
#3 0x00007f0223a3e8e0 (/usr/lib/libc.so.6+0x3e8e0)
#4 0x00007f022b89ef91 (/usr/lib/libclang-cpp.so.13+0xc9ef91)
#5 0x00007f022b8a0c56 (/usr/lib/libclang-cpp.so.13+0xca0c56)
#6 0x00007f022b868d26 clang::DeclContext::addHiddenDecl(clang::Decl*) (/usr/lib/libclang-cpp.so.13+0xc68d26)
#7 0x00007f022b87db3d clang::DeclContext::addDecl(clang::Decl*) (/usr/lib/libclang-cpp.so.13+0xc7db3d)
#8 0x00007f022d2b52df (/usr/lib/libclang-cpp.so.13+0x26b52df)
#9 0x00007f022be24465 clang::Sema::HandleField(clang::Scope*, clang::RecordDecl*, clang::SourceLocation, clang::Declarator&, clang::Expr*, clang::InClassInitStyle, clang::AccessSpecifier) (/usr/lib/libclang-cpp.so.13+0x1224465)
#10 0x00007f022be5ec4c clang::Sema::ActOnCXXMemberDeclarator(clang::Scope*, clang::AccessSpecifier, clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>, clang::Expr*, clang::VirtSpecifiers const&, clang::InClassInitStyle) (/usr/lib/libclang-cpp.so.13+0x125ec4c)
#11 0x00007f022b62fe13 clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject*) (/usr/lib/libclang-cpp.so.13+0xa2fe13)
#12 0x00007f022b6320c8 clang::Parser::ParseCXXClassMemberDeclarationWithPragmas(clang::AccessSpecifier&, clang::ParsedAttributesWithRange&, clang::TypeSpecifierType, clang::Decl*) (/usr/lib/libclang-cpp.so.13+0xa320c8)
#13 0x00007f022b632706 clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, clang::SourceLocation, clang::ParsedAttributesWithRange&, unsigned int, clang::Decl*) (/usr/lib/libclang-cpp.so.13+0xa32706)
#14 0x00007f022b634408 clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext, clang::ParsedAttributesWithRange&) (/usr/lib/libclang-cpp.so.13+0xa34408)
#15 0x00007f022b6223e5 clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*) (/usr/lib/libclang-cpp.so.13+0xa223e5)
#16 0x00007f022b69f91a clang::Parser::ParseSingleDeclarationAfterTemplate(clang::DeclaratorContext, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (/usr/lib/libclang-cpp.so.13+0xa9f91a)
#17 0x00007f022b6a07e0 clang::Parser::ParseTemplateDeclarationOrSpecialization(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (/usr/lib/libclang-cpp.so.13+0xaa07e0)
#18 0x00007f022b6a0d38 clang::Parser::ParseDeclarationStartingWithTemplate(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) (/usr/lib/libclang-cpp.so.13+0xaa0d38)
#19 0x00007f022b62bef8 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributesWithRange&, clang::SourceLocation*) (/usr/lib/libclang-cpp.so.13+0xa2bef8)
#20 0x00007f022b6a2eeb clang::Parser::ParseExternalDeclaration(clang::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/usr/lib/libclang-cpp.so.13+0xaa2eeb)
#21 0x00007f022b60e911 clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (/usr/lib/libclang-cpp.so.13+0xa0e911)
#22 0x00007f022b60e864 clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo, 4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&, clang::BalancedDelimiterTracker&) (/usr/lib/libclang-cpp.so.13+0xa0e864)
#23 0x00007f022b60e864 clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceI
Process clangd stderr finished
Crashes in clang's parser code are generally clang bugs (the parser should handle all input gracefully without crashing, even if the code is invalid).
The libLLVM-13.so
in your stack trace suggests you're using clangd 13, which is several releases out of date. The first thing I would suggest is to try the latest release, clangd 16, and see if the crash persists. (If it does, another thing worth trying is the latest weekly snapshot of the in-development clangd 17.)
If the crash still occurs in the latest snapshot, please report the bug in the clangd issue tracker, keeping in mind the tips at https://clangd.llvm.org/troubleshooting#dealing-with-crashes.