Skip to content

clang stopped working and got crashed #134852

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

Open
varuntuli23 opened this issue Apr 8, 2025 · 7 comments
Open

clang stopped working and got crashed #134852

varuntuli23 opened this issue Apr 8, 2025 · 7 comments
Labels
clangd incomplete Issue not complete (e.g. missing a reproducer, build arguments, etc.) waiting-for-response

Comments

@varuntuli23
Copy link

varuntuli23 commented Apr 8, 2025

clangd: /local/repo/zmauknm/working/llvm-project-llvmorg-20.1.0/clang/lib/AST/ExprConstant.cpp:1760: void {anonymous}::LValue::addUnsizedArray({anonymous}::EvalInfo&, const clang::Expr*, clang::QualType): Assertion `getType(Base)->isPointerType() || getType(Base)->isArrayType()' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	/repo/etlxvrn/trdchandler/sw/trdci/src/trDcHandler.cc:1379:65: current parser token ')'
1.	/repo/etlxvrn/trdchandler/sw/trdci/src/trDcHandler.cc:1376:1: parsing function body 'TrDcHandler::getVersion'
2.	/repo/etlxvrn/trdchandler/sw/trdci/src/trDcHandler.cc:1376:1: in compound statement ('{}')
3.	/repo/etlxvrn/trdchandler/sw/trdci/src/trDcHandler.cc:1378:5: in compound statement ('{}')
 #0 0x0000000000602a9e llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x602a9e)
 #1 0x00000000005ff69b SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f962157b990 __restore_rt (/lib64/libpthread.so.0+0x12990)
 #3 0x00007f962032352f raise (/lib64/libc.so.6+0x4e52f)
 #4 0x00007f96202f6e65 abort (/lib64/libc.so.6+0x21e65)
 #5 0x00007f96202f6d39 _nl_load_domain.cold.0 (/lib64/libc.so.6+0x21d39)
 #6 0x00007f962031be86 (/lib64/libc.so.6+0x46e86)
 #7 0x000000000081bcbf (anonymous namespace)::LValue::addUnsizedArray((anonymous namespace)::EvalInfo&, clang::Expr const*, clang::QualType) ExprConstant.cpp:0:0
 #8 0x000000000089cc8c (anonymous namespace)::PointerExprEvaluator::VisitCastExpr(clang::CastExpr const*) ExprConstant.cpp:0:0
 #9 0x0000000000879188 EvaluatePointer(clang::Expr const*, (anonymous namespace)::LValue&, (anonymous namespace)::EvalInfo&, bool) ExprConstant.cpp:0:0
#10 0x0000000000857295 clang::StmtVisitorBase<llvm::make_const_ptr, (anonymous namespace)::LValueExprEvaluator, bool>::Visit(clang::Stmt const*) ExprConstant.cpp:0:0
#11 0x0000000000855a5b (anonymous namespace)::LValueExprEvaluator::VisitMemberExpr(clang::MemberExpr const*) ExprConstant.cpp:0:0
#12 0x0000000000857561 EvaluateLValue(clang::Expr const*, (anonymous namespace)::LValue&, (anonymous namespace)::EvalInfo&, bool) ExprConstant.cpp:0:0
#13 0x00000000008acb27 (anonymous namespace)::IntExprEvaluator::VisitCastExpr(clang::CastExpr const*) ExprConstant.cpp:0:0
#14 0x000000000085a96e Evaluate(clang::APValue&, (anonymous namespace)::EvalInfo&, clang::Expr const*) ExprConstant.cpp:0:0
#15 0x0000000000863929 EvaluateAsRValue((anonymous namespace)::EvalInfo&, clang::Expr const*, clang::APValue&) ExprConstant.cpp:0:0
#16 0x0000000000866527 clang::Expr::isCXX11ConstantExpr(clang::ASTContext const&, clang::APValue*, clang::SourceLocation*) const (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x866527)
#17 0x00000000008668ad EvaluateCPlusPlus11IntegralConstantExpr(clang::ASTContext const&, clang::Expr const*, llvm::APSInt*, clang::SourceLocation*) ExprConstant.cpp:0:0
#18 0x0000000000869d26 clang::Expr::getIntegerConstantExpr(clang::ASTContext const&, clang::SourceLocation*) const (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x869d26)
#19 0x0000000001391b4f AnalyzeImplicitConversions(clang::Sema&, clang::Expr*, clang::SourceLocation, bool) (.constprop.0) SemaChecking.cpp:0:0
#20 0x0000000001392e7d clang::Sema::CheckCompletedExpr(clang::Expr*, clang::SourceLocation, bool) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x1392e7d)
#21 0x000000000175338c clang::Sema::ActOnFinishFullExpr(clang::Expr*, clang::SourceLocation, bool, bool, bool) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x175338c)
#22 0x0000000001670b3d clang::Sema::ActOnCondition(clang::Scope*, clang::SourceLocation, clang::Expr*, clang::Sema::ConditionKind, bool) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x1670b3d)
#23 0x0000000003fbeb70 clang::Parser::ParseCXXCondition(clang::ActionResult<clang::Stmt*, true>*, clang::SourceLocation, clang::Sema::ConditionKind, bool, clang::Parser::ForRangeInfo*, bool) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x3fbeb70)
#24 0x000000000402e56b clang::Parser::ParseParenExprOrCondition(clang::ActionResult<clang::Stmt*, true>*, clang::Sema::ConditionResult&, clang::SourceLocation, clang::Sema::ConditionKind, clang::SourceLocation&, clang::SourceLocation&) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x402e56b)
#25 0x000000000402fb4e clang::Parser::ParseIfStatement(clang::SourceLocation*) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x402fb4e)
#26 0x00000000040311ad clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x40311ad)
#27 0x0000000004032089 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x4032089)
#28 0x0000000004032fc3 clang::Parser::ParseCompoundStatementBody(bool) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x4032fc3)
#29 0x0000000004033945 clang::Parser::ParseCompoundStatement(bool, unsigned int) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x4033945)
#30 0x00000000040312af clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x40312af)
#31 0x0000000004032089 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x4032089)
#32 0x0000000004036680 clang::Parser::ParseStatement(clang::SourceLocation*, clang::Parser::ParsedStmtContext) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x4036680)
#33 0x00000000040372c1 clang::Parser::ParseForStatement(clang::SourceLocation*) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x40372c1)
#34 0x0000000004031186 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x4031186)
#35 0x0000000004032089 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x4032089)
#36 0x0000000004032fc3 clang::Parser::ParseCompoundStatementBody(bool) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x4032fc3)
#37 0x0000000004033827 clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x4033827)
#38 0x0000000003f2d6aa clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x3f2d6aa)
#39 0x0000000003f759ce clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x3f759ce)
#40 0x0000000003f27c19 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x3f27c19)
#41 0x0000000003f283e8 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x3f283e8)
#42 0x0000000003f31aa8 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x3f31aa8)
#43 0x0000000003f32ad5 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x3f32ad5)
#44 0x0000000003f21d2a clang::ParseAST(clang::Sema&, bool, bool) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x3f21d2a)
#45 0x0000000003c40003 clang::FrontendAction::Execute() (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x3c40003)
#46 0x0000000001f59e43 clang::clangd::BackgroundIndex::index(clang::tooling::CompileCommand) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x1f59e43)
#47 0x0000000001f5bab5 clang::clangd::BackgroundIndex::indexFileTask(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)::'lambda'()::operator()() const Background.cpp:0:0
#48 0x0000000001f67678 clang::clangd::BackgroundQueue::work(std::function<void ()>) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x1f67678)
#49 0x0000000001f55206 void llvm::detail::UniqueFunctionBase<void>::CallImpl<clang::clangd::BackgroundIndex::BackgroundIndex(clang::clangd::ThreadsafeFS const&, clang::clangd::GlobalCompilationDatabase const&, llvm::unique_function<clang::clangd::BackgroundIndexStorage* (llvm::StringRef)>, clang::clangd::BackgroundIndex::Options)::'lambda'()>(void*) Background.cpp:0:0
#50 0x000000000201c93a void* llvm::thread::ThreadProxy<std::tuple<clang::clangd::AsyncTaskRunner::runAsync(llvm::Twine const&, llvm::unique_function<void ()>)::'lambda0'()>>(void*) Threading.cpp:0:0
#51 0x00007f96215711ca start_thread (/lib64/libpthread.so.0+0x81ca)
#52 0x00007f962030e8d3 clone (/lib64/libc.so.6+0x398d3)
[Error - 2:58:02 PM] 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 - 2:58:02 PM] Request textDocument/documentSymbol failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/codeAction failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/documentLink failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/foldingRange failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/semanticTokens/full failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/inlayHint failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/hover failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/hover failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/hover failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/hover failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/inlayHint failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/definition failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/hover failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/hover failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/documentHighlight failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/definition failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/codeAction failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/hover failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/definition failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/definition failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/hover failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/hover failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/documentHighlight failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/codeAction failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/documentHighlight failed.
[object Object]
[Error - 2:58:02 PM] Request textDocument/codeAction failed.
[object Object]
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Apr 8, 2025
@AaronBallman AaronBallman added incomplete Issue not complete (e.g. missing a reproducer, build arguments, etc.) waiting-for-response labels Apr 8, 2025
@AaronBallman
Copy link
Collaborator

Can you attach a code example (or Compiler Explorer link) so we can reproduce the issue?

@EugeneZelenko EugeneZelenko added clangd and removed clang Clang issues not falling into any other category labels Apr 8, 2025
@llvmbot
Copy link
Member

llvmbot commented Apr 8, 2025

@llvm/issue-subscribers-clangd

Author: None (varuntuli23)

clangd: /local/repo/zmauknm/working/llvm-project-llvmorg-20.1.0/clang/lib/AST/ExprConstant.cpp:1760: void {anonymous}::LValue::addUnsizedArray({anonymous}::EvalInfo&, const clang::Expr*, clang::QualType): Assertion `getType(Base)->isPointerType() || getType(Base)->isArrayType()' failed. PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace. Stack dump: 0. /repo/etlxvrn/trdchandler/sw/trdci/src/trDcHandler.cc:1379:65: current parser token ')' 1. /repo/etlxvrn/trdchandler/sw/trdci/src/trDcHandler.cc:1376:1: parsing function body 'TrDcHandler::getVersion' 2. /repo/etlxvrn/trdchandler/sw/trdci/src/trDcHandler.cc:1376:1: in compound statement ('{}') 3. /repo/etlxvrn/trdchandler/sw/trdci/src/trDcHandler.cc:1378:5: in compound statement ('{}') #0 0x0000000000602a9e llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x602a9e) #1 0x00000000005ff69b SignalHandler(int) Signals.cpp:0:0 #2 0x00007f962157b990 __restore_rt (/lib64/libpthread.so.0+0x12990) #3 0x00007f962032352f raise (/lib64/libc.so.6+0x4e52f) #4 0x00007f96202f6e65 abort (/lib64/libc.so.6+0x21e65) #5 0x00007f96202f6d39 _nl_load_domain.cold.0 (/lib64/libc.so.6+0x21d39) #6 0x00007f962031be86 (/lib64/libc.so.6+0x46e86) #7 0x000000000081bcbf (anonymous namespace)::LValue::addUnsizedArray((anonymous namespace)::EvalInfo&, clang::Expr const*, clang::QualType) ExprConstant.cpp:0:0 #8 0x000000000089cc8c (anonymous namespace)::PointerExprEvaluator::VisitCastExpr(clang::CastExpr const*) ExprConstant.cpp:0:0 #9 0x0000000000879188 EvaluatePointer(clang::Expr const*, (anonymous namespace)::LValue&, (anonymous namespace)::EvalInfo&, bool) ExprConstant.cpp:0:0 #10 0x0000000000857295 clang::StmtVisitorBase<llvm::make_const_ptr, (anonymous namespace)::LValueExprEvaluator, bool>::Visit(clang::Stmt const*) ExprConstant.cpp:0:0 #11 0x0000000000855a5b (anonymous namespace)::LValueExprEvaluator::VisitMemberExpr(clang::MemberExpr const*) ExprConstant.cpp:0:0 #12 0x0000000000857561 EvaluateLValue(clang::Expr const*, (anonymous namespace)::LValue&, (anonymous namespace)::EvalInfo&, bool) ExprConstant.cpp:0:0 #13 0x00000000008acb27 (anonymous namespace)::IntExprEvaluator::VisitCastExpr(clang::CastExpr const*) ExprConstant.cpp:0:0 #14 0x000000000085a96e Evaluate(clang::APValue&, (anonymous namespace)::EvalInfo&, clang::Expr const*) ExprConstant.cpp:0:0 #15 0x0000000000863929 EvaluateAsRValue((anonymous namespace)::EvalInfo&, clang::Expr const*, clang::APValue&) ExprConstant.cpp:0:0 #16 0x0000000000866527 clang::Expr::isCXX11ConstantExpr(clang::ASTContext const&, clang::APValue*, clang::SourceLocation*) const (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x866527) #17 0x00000000008668ad EvaluateCPlusPlus11IntegralConstantExpr(clang::ASTContext const&, clang::Expr const*, llvm::APSInt*, clang::SourceLocation*) ExprConstant.cpp:0:0 #18 0x0000000000869d26 clang::Expr::getIntegerConstantExpr(clang::ASTContext const&, clang::SourceLocation*) const (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x869d26) #19 0x0000000001391b4f AnalyzeImplicitConversions(clang::Sema&, clang::Expr*, clang::SourceLocation, bool) (.constprop.0) SemaChecking.cpp:0:0 #20 0x0000000001392e7d clang::Sema::CheckCompletedExpr(clang::Expr*, clang::SourceLocation, bool) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x1392e7d) #21 0x000000000175338c clang::Sema::ActOnFinishFullExpr(clang::Expr*, clang::SourceLocation, bool, bool, bool) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x175338c) #22 0x0000000001670b3d clang::Sema::ActOnCondition(clang::Scope*, clang::SourceLocation, clang::Expr*, clang::Sema::ConditionKind, bool) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x1670b3d) #23 0x0000000003fbeb70 clang::Parser::ParseCXXCondition(clang::ActionResult<clang::Stmt*, true>*, clang::SourceLocation, clang::Sema::ConditionKind, bool, clang::Parser::ForRangeInfo*, bool) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x3fbeb70) #24 0x000000000402e56b clang::Parser::ParseParenExprOrCondition(clang::ActionResult<clang::Stmt*, true>*, clang::Sema::ConditionResult&, clang::SourceLocation, clang::Sema::ConditionKind, clang::SourceLocation&, clang::SourceLocation&) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x402e56b) #25 0x000000000402fb4e clang::Parser::ParseIfStatement(clang::SourceLocation*) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x402fb4e) #26 0x00000000040311ad clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x40311ad) #27 0x0000000004032089 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x4032089) #28 0x0000000004032fc3 clang::Parser::ParseCompoundStatementBody(bool) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x4032fc3) #29 0x0000000004033945 clang::Parser::ParseCompoundStatement(bool, unsigned int) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x4033945) #30 0x00000000040312af clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x40312af) #31 0x0000000004032089 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x4032089) #32 0x0000000004036680 clang::Parser::ParseStatement(clang::SourceLocation*, clang::Parser::ParsedStmtContext) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x4036680) #33 0x00000000040372c1 clang::Parser::ParseForStatement(clang::SourceLocation*) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x40372c1) #34 0x0000000004031186 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x4031186) #35 0x0000000004032089 clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x4032089) #36 0x0000000004032fc3 clang::Parser::ParseCompoundStatementBody(bool) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x4032fc3) #37 0x0000000004033827 clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x4033827) #38 0x0000000003f2d6aa clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x3f2d6aa) #39 0x0000000003f759ce clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x3f759ce) #40 0x0000000003f27c19 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x3f27c19) #41 0x0000000003f283e8 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x3f283e8) #42 0x0000000003f31aa8 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x3f31aa8) #43 0x0000000003f32ad5 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x3f32ad5) #44 0x0000000003f21d2a clang::ParseAST(clang::Sema&, bool, bool) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x3f21d2a) #45 0x0000000003c40003 clang::FrontendAction::Execute() (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x3c40003) #46 0x0000000001f59e43 clang::clangd::BackgroundIndex::index(clang::tooling::CompileCommand) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x1f59e43) #47 0x0000000001f5bab5 clang::clangd::BackgroundIndex::indexFileTask(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)::'lambda'()::operator()() const Background.cpp:0:0 #48 0x0000000001f67678 clang::clangd::BackgroundQueue::work(std::function<void ()>) (/app/vbuild/RHEL8-x86_64/clang/20.1.0/bin/clangd+0x1f67678) #49 0x0000000001f55206 void llvm::detail::UniqueFunctionBase<void>::CallImpl<clang::clangd::BackgroundIndex::BackgroundIndex(clang::clangd::ThreadsafeFS const&, clang::clangd::GlobalCompilationDatabase const&, llvm::unique_function<clang::clangd::BackgroundIndexStorage* (llvm::StringRef)>, clang::clangd::BackgroundIndex::Options)::'lambda'()>(void*) Background.cpp:0:0 #50 0x000000000201c93a void* llvm::thread::ThreadProxy<std::tuple<clang::clangd::AsyncTaskRunner::runAsync(llvm::Twine const&, llvm::unique_function<void ()>)::'lambda0'()>>(void*) Threading.cpp:0:0 #51 0x00007f96215711ca start_thread (/lib64/libpthread.so.0+0x81ca) #52 0x00007f962030e8d3 clone (/lib64/libc.so.6+0x398d3) [Error - 2:58:02 PM] 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 - 2:58:02 PM] Request textDocument/documentSymbol failed. [object Object] [Error - 2:58:02 PM] Request textDocument/codeAction failed. [object Object] [Error - 2:58:02 PM] Request textDocument/documentLink failed. [object Object] [Error - 2:58:02 PM] Request textDocument/foldingRange failed. [object Object] [Error - 2:58:02 PM] Request textDocument/semanticTokens/full failed. [object Object] [Error - 2:58:02 PM] Request textDocument/inlayHint failed. [object Object] [Error - 2:58:02 PM] Request textDocument/hover failed. [object Object] [Error - 2:58:02 PM] Request textDocument/hover failed. [object Object] [Error - 2:58:02 PM] Request textDocument/hover failed. [object Object] [Error - 2:58:02 PM] Request textDocument/hover failed. [object Object] [Error - 2:58:02 PM] Request textDocument/inlayHint failed. [object Object] [Error - 2:58:02 PM] Request textDocument/definition failed. [object Object] [Error - 2:58:02 PM] Request textDocument/hover failed. [object Object] [Error - 2:58:02 PM] Request textDocument/hover failed. [object Object] [Error - 2:58:02 PM] Request textDocument/documentHighlight failed. [object Object] [Error - 2:58:02 PM] Request textDocument/definition failed. [object Object] [Error - 2:58:02 PM] Request textDocument/codeAction failed. [object Object] [Error - 2:58:02 PM] Request textDocument/hover failed. [object Object] [Error - 2:58:02 PM] Request textDocument/definition failed. [object Object] [Error - 2:58:02 PM] Request textDocument/definition failed. [object Object] [Error - 2:58:02 PM] Request textDocument/hover failed. [object Object] [Error - 2:58:02 PM] Request textDocument/hover failed. [object Object] [Error - 2:58:02 PM] Request textDocument/documentHighlight failed. [object Object] [Error - 2:58:02 PM] Request textDocument/codeAction failed. [object Object] [Error - 2:58:02 PM] Request textDocument/documentHighlight failed. [object Object] [Error - 2:58:02 PM] Request textDocument/codeAction failed. [object Object]

@HighCommander4
Copy link
Collaborator

HighCommander4 commented Apr 8, 2025

Potential duplicate of #120085 (same assertion failure, getType(Base)->isPointerType() || getType(Base)->isArrayType()), which has a test case

@HighCommander4
Copy link
Collaborator

A couple of other reports of the same assertion failure: #50214, #69468

@varuntuli23
Copy link
Author

Stack dump:
0. current parser token ')' line 1

  1. parsing function body 'function_name' line 2
  2. in compound statement ('{}') line 3
  3. in compound statement ('{}') line 5

bool getHandler::getAsic(int32_t clientId)
{ --> line 2 / line 3
for (uint32_t index = 0; index < 5; ++index) --> line 1
{ --->line 5
if (clientId == m_var[index].serverRef)
{
return false;
}
}
return true;
}

@varuntuli23
Copy link
Author

Can you attach a code example (or Compiler Explorer link) so we can reproduce the issue?

replied above, please have a look.

@AaronBallman
Copy link
Collaborator

Can you attach a code example (or Compiler Explorer link) so we can reproduce the issue?

replied above, please have a look.

Unfortunately, that's not a complete reproducer (unless there's an attachment somewhere I'm not able to spot). We need the original source code (or preprocessed output from it), if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clangd incomplete Issue not complete (e.g. missing a reproducer, build arguments, etc.) waiting-for-response
Projects
None yet
Development

No branches or pull requests

5 participants