You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用LSP时clangd频繁崩溃,CLion中运行稳定,求故障原因

clangd在LSP环境下频繁崩溃,CLion中运行稳定
  • 问题现象:使用通用LSP时,clangd每稳定运行5分钟就会崩溃;但在CLion中(采用不同实现方案),clangd运行完全正常
  • 已尝试操作:重新安装LSP与clangd、更换多个clangd版本,故障仍未解决

以下是崩溃日志:

I[15:01:48.739] 已索引 /home/user-name/Sources/Gui/datamodel/QModel.cpp(523个符号,50679个引用,1972个文件)
I[15:01:48.778] --> $/progress
I[15:01:48.779] --> $/progress
I[15:01:49.240] 已索引 /home/user-name/main/Sources/Engine/ParserTests.cpp(643个符号,59880个引用,2422个文件)
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

内容的提问来源于stack exchange,提问作者HamsterGamer

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.21 18:45:00