-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"crash-on-invalidregression
Description
https://clang.godbolt.org/z/qW57zPWK1
The previous patch that attempted to address this bug seems to be not enough.
Release 15.0, 16.0, and the trunk are affected.
clangd: /repo/llvm-project/clang/lib/Sema/SemaExpr.cpp:18662: void clang::Sema::MarkFunctionReferenced(SourceLocation, FunctionDecl *, bool): Assertion `Func && "No function?"' failed.
#0 0x00007f01a535ddbd llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /repo/llvm-project/llvm/lib/Support/Unix/Signals.inc:602:11
#1 0x00007f01a535e25b PrintStackTraceSignalHandler(void*) /repo/llvm-project/llvm/lib/Support/Unix/Signals.inc:675:1
#2 0x00007f01a535c516 llvm::sys::RunSignalHandlers() /repo/llvm-project/llvm/lib/Support/Signals.cpp:104:5
#3 0x00007f01a535ea15 SignalHandler(int) /repo/llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1
#4 0x00007f01a47aef60 __restore_rt sigaction.c:0:0
#5 0x00007f01a3c5f47a raise /root/glibc-2.33/signal/../sysdeps/unix/sysv/linux/raise.c:50:0
#6 0x00007f01a3c6045e abort /root/glibc-2.33/stdlib/abort.c:81:0
#7 0x00007f01a3c5811a __assert_fail_base /root/glibc-2.33/assert/assert.c:89:0
#8 0x00007f01a3c58192 (/lib64/libc.so.6+0x33192)
#9 0x00007f01a6d8f81f clang::Sema::MarkFunctionReferenced(clang::SourceLocation, clang::FunctionDecl*, bool) /repo/llvm-project/clang/lib/Sema/SemaExpr.cpp:18664:3
#10 0x00007f01a6b3b372 clang::Sema::FinalizeVarWithDestructor(clang::VarDecl*, clang::RecordType const*) /repo/llvm-project/clang/lib/Sema/SemaDeclCXX.cpp:15817:27
#11 0x00007f01a69d4ad5 clang::Sema::CheckCompleteVariableDeclaration(clang::VarDecl*) /repo/llvm-project/clang/lib/Sema/SemaDecl.cpp:14297:27
#12 0x00007f01a69d32e0 clang::Sema::AddInitializerToDecl(clang::Decl*, clang::Expr*, bool) /repo/llvm-project/clang/lib/Sema/SemaDecl.cpp:13599:1
#13 0x00007f01aa639e4a clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) /repo/llvm-project/clang/lib/Parse/ParseDecl.cpp:0:15
#14 0x00007f01aa637d95 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) /repo/llvm-project/clang/lib/Parse/ParseDecl.cpp:2260:9
#15 0x00007f01aa636dc1 clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, bool, clang::Parser::ForRangeInit*, clang::SourceLocation*) /repo/llvm-project/clang/lib/Parse/ParseDecl.cpp:1953:10
#16 0x00007f01aa6369f9 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedAttributes&, clang::SourceLocation*) /repo/llvm-project/clang/lib/Parse/ParseDecl.cpp:1881:12
#17 0x00007f01aa7028b9 clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::ParsedAttributes&, clang::ParsedAttributes&) /repo/llvm-project/clang/lib/Parse/ParseStmt.cpp:249:16
#18 0x00007f01aa70221b clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) /repo/llvm-project/clang/lib/Parse/ParseStmt.cpp:117:20
#19 0x00007f01aa70af92 clang::Parser::ParseCompoundStatementBody(bool) /repo/llvm-project/clang/lib/Parse/ParseStmt.cpp:1205:11
#20 0x00007f01aa70c694 clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) /repo/llvm-project/clang/lib/Parse/ParseStmt.cpp:2467:21
#21 0x00007f01aa72d7cf clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) /repo/llvm-project/clang/lib/Parse/Parser.cpp:1471:3
#22 0x00007f01aa63797b clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::SourceLocation*, clang::Parser::ForRangeInit*) /repo/llvm-project/clang/lib/Parse/ParseDecl.cpp:2195:27
#23 0x00007f01aa72c64a clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) /repo/llvm-project/clang/lib/Parse/Parser.cpp:1210:10
#24 0x00007f01aa72bb8f clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) /repo/llvm-project/clang/lib/Parse/Parser.cpp:1225:12
#25 0x00007f01aa72b463 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) /repo/llvm-project/clang/lib/Parse/Parser.cpp:1040:14
#26 0x00007f01aa72932c clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) /repo/llvm-project/clang/lib/Parse/Parser.cpp:742:12
#27 0x00007f01aa623477 clang::ParseAST(clang::Sema&, bool, bool) /repo/llvm-project/clang/lib/Parse/ParseAST.cpp:163:16
#28 0x00007f01a6271916 clang::ASTFrontendAction::ExecuteAction() /repo/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1170:1
#29 0x00007f01a627133c clang::FrontendAction::Execute() /repo/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1062:7
#30 0x00007f01a80a9aa7 clang::clangd::ParsedAST::build(llvm::StringRef, clang::clangd::ParseInputs const&, std::unique_ptr<clang::CompilerInvocation, std::default_delete<clang::CompilerInvocation>>, llvm::ArrayRef<clang::clangd::Diag>, std::shared_ptr<clang::clangd::PreambleData const>) /repo/llvm-project/clang-tools-extra/clangd/ParsedAST.cpp:685:19
#31 0x00007f01a51ba45a clang::clangd::(anonymous namespace)::Checker::buildAST() /repo/llvm-project/clang-tools-extra/clangd/tool/Check.cpp:248:11
#32 0x00007f01a51b9670 clang::clangd::check(llvm::StringRef, clang::clangd::ThreadsafeFS const&, clang::clangd::ClangdLSPServer::Options const&) /repo/llvm-project/clang-tools-extra/clangd/tool/Check.cpp:487:7
#33 0x00007f01a517efba main /repo/llvm-project/clang-tools-extra/clangd/tool/ClangdMain.cpp:993:12
#34 0x00007f01a3c4b5e0 __libc_start_main /root/glibc-2.33/csu/../csu/libc-start.c:366:0
#35 0x00007f01a4e1925a _start /root/glibc-2.33/csu/../sysdeps/x86_64/start.S:122:0
[1] 11209 abort /repo/llvm-project-Build/BuildDebug/bin/clangd
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"crash-on-invalidregression