[llvm-bugs] [Bug 50768] New: Compiler crashes while instantiating function definition

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jun 18 08:00:25 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50768

            Bug ID: 50768
           Summary: Compiler crashes while instantiating function
                    definition
           Product: clang
           Version: 12.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: qtom.boehmer at googlemail.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /usr/bin/clang-12 -cc1 -triple x86_64-pc-linux-gnu
-emit-obj -mrelax-all --mrelax-relocations -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name test.cxx -mrelocation-model pic -pic-level
2 -pic-is-pie -mframe-pointer=all -fmath-errno -fno-rounding-math
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic
-fno-split-dwarf-inlining -debugger-tuning=gdb -resource-dir
/usr/lib/clang/12.0.0 -internal-isystem
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0
-internal-isystem
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/x86_64-pc-linux-gnu
-internal-isystem
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/lib/clang/12.0.0/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++20 -fdeprecated-macro
-fdebug-compilation-dir /home/dep/workspace/tests/matrix -ferror-limit 19
-stack-protector 2 -fgnuc-version=4.2.1 -fno-implicit-modules -fcxx-exceptions
-fexceptions -faddrsig -o /tmp/test-cb3203.o -x c++ test.cxx
1.      ./tuple.hxx:124:36: current parser token ')'
2.      ./tuple.hxx:8:1: parsing namespace 'tuple'
3.      ./tuple.hxx:113:7: instantiating function definition 'tuple::tail<2,
int, int, int>'
 #0 0x00007fb893460653 (/usr/bin/../lib/libLLVM-12.so+0xb48653)
 #1 0x00007fb89345dd56 (/usr/bin/../lib/libLLVM-12.so+0xb45d56)
 #2 0x00007fb89256cda0 __restore_rt (/usr/bin/../lib/libc.so.6+0x3cda0)
 #3 0x00007fb899f59bb8 clang::Sema::tryCaptureVariable(clang::VarDecl*,
clang::SourceLocation, clang::Sema::TryCaptureKind, clang::SourceLocation,
bool, clang::QualType&, clang::QualType&, unsigned int const*)
(/usr/bin/../lib/libclang-cpp.so.12+0x13a1bb8)
 #4 0x00007fb899f5c7d1 clang::Sema::getCapturedDeclRefType(clang::VarDecl*,
clang::SourceLocation) (/usr/bin/../lib/libclang-cpp.so.12+0x13a47d1)
 #5 0x00007fb899f62c38
clang::Sema::BuildDeclarationNameExpr(clang::CXXScopeSpec const&,
clang::DeclarationNameInfo const&, clang::NamedDecl*, clang::NamedDecl*,
clang::TemplateArgumentListInfo const*, bool)
(/usr/bin/../lib/libclang-cpp.so.12+0x13aac38)
 #6 0x00007fb89a3c927c (/usr/bin/../lib/libclang-cpp.so.12+0x181127c)
 #7 0x00007fb89a3a3b21 (/usr/bin/../lib/libclang-cpp.so.12+0x17ebb21)
 #8 0x00007fb89a3a8037 (/usr/bin/../lib/libclang-cpp.so.12+0x17f0037)
 #9 0x00007fb89a3a800d (/usr/bin/../lib/libclang-cpp.so.12+0x17f000d)
#10 0x00007fb89a3b7c73 (/usr/bin/../lib/libclang-cpp.so.12+0x17ffc73)
#11 0x00007fb89a3ba4ea (/usr/bin/../lib/libclang-cpp.so.12+0x18024ea)
#12 0x00007fb89a3b212f (/usr/bin/../lib/libclang-cpp.so.12+0x17fa12f)
#13 0x00007fb89a3b4a68 (/usr/bin/../lib/libclang-cpp.so.12+0x17fca68)
#14 0x00007fb89a3b7cd6 (/usr/bin/../lib/libclang-cpp.so.12+0x17ffcd6)
#15 0x00007fb89a3ba74c (/usr/bin/../lib/libclang-cpp.so.12+0x180274c)
#16 0x00007fb89a3b212f (/usr/bin/../lib/libclang-cpp.so.12+0x17fa12f)
#17 0x00007fb89a3c5d9c
clang::Sema::SubstFunctionDeclType(clang::TypeSourceInfo*,
clang::MultiLevelTemplateArgumentList const&, clang::SourceLocation,
clang::DeclarationName, clang::CXXRecordDecl*, clang::Qualifiers)
(/usr/bin/../lib/libclang-cpp.so.12+0x180dd9c)
#18 0x00007fb89a3de1bb
clang::TemplateDeclInstantiator::SubstFunctionType(clang::FunctionDecl*,
llvm::SmallVectorImpl<clang::ParmVarDecl*>&)
(/usr/bin/../lib/libclang-cpp.so.12+0x18261bb)
#19 0x00007fb89a3f7279
clang::TemplateDeclInstantiator::VisitCXXMethodDecl(clang::CXXMethodDecl*,
clang::TemplateParameterList*,
llvm::Optional<clang::ASTTemplateArgumentListInfo const*>,
clang::TemplateDeclInstantiator::RewriteKind)
(/usr/bin/../lib/libclang-cpp.so.12+0x183f279)
#20 0x00007fb89a3f8f84 (/usr/bin/../lib/libclang-cpp.so.12+0x1840f84)
#21 0x00007fb899bf68f2
clang::Sema::runWithSufficientStackSpace(clang::SourceLocation,
llvm::function_ref<void ()>) (/usr/bin/../lib/libclang-cpp.so.12+0x103e8f2)
#22 0x00007fb89a3ddd36 clang::Sema::SubstDecl(clang::Decl*,
clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&)
(/usr/bin/../lib/libclang-cpp.so.12+0x1825d36)
#23 0x00007fb89a37c7e2
clang::Sema::FinishTemplateArgumentDeduction(clang::FunctionTemplateDecl*,
llvm::SmallVectorImpl<clang::DeducedTemplateArgument>&, unsigned int,
clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&,
llvm::SmallVectorImpl<clang::Sema::OriginalCallArg> const*, bool,
llvm::function_ref<bool ()>) (/usr/bin/../lib/libclang-cpp.so.12+0x17c47e2)
#24 0x00007fb89a37e08a (/usr/bin/../lib/libclang-cpp.so.12+0x17c608a)
#25 0x00007fb899bf68f2
clang::Sema::runWithSufficientStackSpace(clang::SourceLocation,
llvm::function_ref<void ()>) (/usr/bin/../lib/libclang-cpp.so.12+0x103e8f2)
#26 0x00007fb89a388fd4
clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*,
clang::TemplateArgumentListInfo*, llvm::ArrayRef<clang::Expr*>,
clang::FunctionDecl*&, clang::sema::TemplateDeductionInfo&, bool,
llvm::function_ref<bool (llvm::ArrayRef<clang::QualType>)>)
(/usr/bin/../lib/libclang-cpp.so.12+0x17d0fd4)
#27 0x00007fb89a207cd4 (/usr/bin/../lib/libclang-cpp.so.12+0x164fcd4)
#28 0x00007fb89a20812d clang::Sema::AddMethodCandidate(clang::DeclAccessPair,
clang::QualType, clang::Expr::Classification, llvm::ArrayRef<clang::Expr*>,
clang::OverloadCandidateSet&, bool, clang::OverloadCandidateParamOrder)
(/usr/bin/../lib/libclang-cpp.so.12+0x165012d)
#29 0x00007fb89a222385 clang::Sema::BuildCallToObjectOfClassType(clang::Scope*,
clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>,
clang::SourceLocation) (/usr/bin/../lib/libclang-cpp.so.12+0x166a385)
#30 0x00007fb899f9314e clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*,
clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>,
clang::SourceLocation, clang::Expr*)
(/usr/bin/../lib/libclang-cpp.so.12+0x13db14e)
#31 0x00007fb89a3ac90d (/usr/bin/../lib/libclang-cpp.so.12+0x17f490d)
#32 0x00007fb89a3a6897 (/usr/bin/../lib/libclang-cpp.so.12+0x17ee897)
#33 0x00007fb89a3d3c53 (/usr/bin/../lib/libclang-cpp.so.12+0x181bc53)
#34 0x00007fb89a3d7f0c clang::Sema::SubstStmt(clang::Stmt*,
clang::MultiLevelTemplateArgumentList const&)
(/usr/bin/../lib/libclang-cpp.so.12+0x181ff0c)
#35 0x00007fb89a3ef11f
clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl*, bool, bool, bool)
(/usr/bin/../lib/libclang-cpp.so.12+0x183711f)
#36 0x00007fb899bf68f2
clang::Sema::runWithSufficientStackSpace(clang::SourceLocation,
llvm::function_ref<void ()>) (/usr/bin/../lib/libclang-cpp.so.12+0x103e8f2)
#37 0x00007fb89a33c260 clang::Sema::DeduceReturnType(clang::FunctionDecl*,
clang::SourceLocation, bool) (/usr/bin/../lib/libclang-cpp.so.12+0x1784260)
#38 0x00007fb899f426e5 clang::Sema::DiagnoseUseOfDecl(clang::NamedDecl*,
llvm::ArrayRef<clang::SourceLocation>, clang::ObjCInterfaceDecl const*, bool,
bool, clang::ObjCInterfaceDecl*) (/usr/bin/../lib/libclang-cpp.so.12+0x138a6e5)
#39 0x00007fb89a21a568 (/usr/bin/../lib/libclang-cpp.so.12+0x1662568)
#40 0x00007fb89a21b10c clang::Sema::BuildOverloadedCallExpr(clang::Scope*,
clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation,
llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool,
bool) (/usr/bin/../lib/libclang-cpp.so.12+0x166310c)
#41 0x00007fb899f92393 clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*,
clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>,
clang::SourceLocation, clang::Expr*, bool, bool)
(/usr/bin/../lib/libclang-cpp.so.12+0x13da393)
#42 0x00007fb899f9314e clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*,
clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>,
clang::SourceLocation, clang::Expr*)
(/usr/bin/../lib/libclang-cpp.so.12+0x13db14e)
#43 0x00007fb8995434db
clang::Parser::ParsePostfixExpressionSuffix(clang::ActionResult<clang::Expr*,
true>) (/usr/bin/../lib/libclang-cpp.so.12+0x98b4db)
#44 0x00007fb89953c892
clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&,
clang::Parser::TypeCastState, bool, bool*)
(/usr/bin/../lib/libclang-cpp.so.12+0x984892)
#45 0x00007fb89953dfb7
clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&,
clang::Parser::TypeCastState, bool, bool*)
(/usr/bin/../lib/libclang-cpp.so.12+0x985fb7)
#46 0x00007fb89954afc9
clang::Parser::ParseConstantExpressionInExprEvalContext(clang::Parser::TypeCastState)
(/usr/bin/../lib/libclang-cpp.so.12+0x992fc9)
#47 0x00007fb899527055
clang::Parser::ParseStaticAssertDeclaration(clang::SourceLocation&)
(/usr/bin/../lib/libclang-cpp.so.12+0x96f055)
#48 0x00007fb899519002
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&,
clang::SourceLocation*) (/usr/bin/../lib/libclang-cpp.so.12+0x961002)
#49 0x00007fb8995dd435
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/usr/bin/../lib/libclang-cpp.so.12+0xa25435)
#50 0x00007fb89952e505
clang::Parser::ParseInnerNamespace(llvm::SmallVector<clang::Parser::InnerNamespaceInfo,
4u> const&, unsigned int, clang::SourceLocation&, clang::ParsedAttributes&,
clang::BalancedDelimiterTracker&) (/usr/bin/../lib/libclang-cpp.so.12+0x976505)
#51 0x00007fb899535c63 clang::Parser::ParseNamespace(clang::DeclaratorContext,
clang::SourceLocation&, clang::SourceLocation)
(/usr/bin/../lib/libclang-cpp.so.12+0x97dc63)
#52 0x00007fb8995190ce
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&,
clang::SourceLocation*) (/usr/bin/../lib/libclang-cpp.so.12+0x9610ce)
#53 0x00007fb8995dd435
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/usr/bin/../lib/libclang-cpp.so.12+0xa25435)
#54 0x00007fb8995de91a
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
(/usr/bin/../lib/libclang-cpp.so.12+0xa2691a)
#55 0x00007fb8994ef422 clang::ParseAST(clang::Sema&, bool, bool)
(/usr/bin/../lib/libclang-cpp.so.12+0x937422)
#56 0x00007fb89af3a249 clang::FrontendAction::Execute()
(/usr/bin/../lib/libclang-cpp.so.12+0x2382249)
#57 0x00007fb89aed154e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/bin/../lib/libclang-cpp.so.12+0x231954e)
#58 0x00007fb89afba929
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/bin/../lib/libclang-cpp.so.12+0x2402929)
#59 0x000055ab2e0778de cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/bin/clang-12+0x128de)
#60 0x000055ab2e074ee8 (/usr/bin/clang-12+0xfee8)
#61 0x000055ab2e071505 main (/usr/bin/clang-12+0xc505)
#62 0x00007fb892557b25 __libc_start_main (/usr/bin/../lib/libc.so.6+0x27b25)
#63 0x000055ab2e07486e _start (/usr/bin/clang-12+0xf86e)
clang-12: error: unable to execute command: Segmentation fault (core dumped)
clang-12: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 12.0.0
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang-12: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-12: note: diagnostic msg: /tmp/test-12a93b.cpp
clang-12: note: diagnostic msg: /tmp/test-12a93b.sh
clang-12: note: diagnostic msg: 

********************

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210618/344685e9/attachment.html>


More information about the llvm-bugs mailing list