[llvm-bugs] [Bug 51164] New: ICE: clang crash in clang::ASTContext::getFunctionTypeInternal(clang::QualType, llvm::ArrayRef<clang::QualType>, clang::FunctionProtoType::ExtProtoInfo const&, bool)

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 22 02:01:05 PDT 2021


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

            Bug ID: 51164
           Summary: ICE: clang crash in
                    clang::ASTContext::getFunctionTypeInternal(clang::Qual
                    Type, llvm::ArrayRef<clang::QualType>,
                    clang::FunctionProtoType::ExtProtoInfo const&, bool)
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: czktc2007 at gmail.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Reproducable code:
https://godbolt.org/z/9r3d1jTxq

Fails on 6.x/7.x/8.x, OK on 9.x and newer.

Crash output:

Stack dump:
0.      Program arguments: /opt/compiler-explorer/clang-8.0.1/bin/clang-8 -cc1
-triple x86_64-unknown-linux-gnu -S -disable-free -disable-llvm-verifier
-discard-value-names -main-file-name example.cpp -mrelocation-model static
-mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-dwarf-column-info -debug-info-kind=limited -dwarf-version=4
-debugger-tuning=gdb -coverage-notes-file /app/output.gcno -resource-dir
/opt/compiler-explorer/clang-8.0.1/lib/clang/8.0.1 -isystem
/opt/compiler-explorer/libs/boost_1_76_0 -internal-isystem
/opt/compiler-explorer/gcc-8.3.0/lib/gcc/x86_64-linux-gnu/8.3.0/../../../../include/c++/8.3.0
-internal-isystem
/opt/compiler-explorer/gcc-8.3.0/lib/gcc/x86_64-linux-gnu/8.3.0/../../../../include/c++/8.3.0/x86_64-linux-gnu
-internal-isystem
/opt/compiler-explorer/gcc-8.3.0/lib/gcc/x86_64-linux-gnu/8.3.0/../../../../include/c++/8.3.0/backward
-internal-isystem /usr/local/include -internal-isystem
/opt/compiler-explorer/clang-8.0.1/lib/clang/8.0.1/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-std=c++17 -fdeprecated-macro -fdebug-compilation-dir /app -ferror-limit 19
-fmessage-length 0 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -mllvm --x86-asm-syntax=intel -o
/app/output.s -x c++ <source> -faddrsig 
1.      <source>:67:1: current parser token '{'
 #0 0x0000562afc9c6d2a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x243fd2a)
 #1 0x0000562afc9c4ce4 llvm::sys::RunSignalHandlers()
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x243dce4)
 #2 0x0000562afc9c4e22 SignalHandler(int)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x243de22)
 #3 0x00007f33ac3483c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #4 0x0000562afe52754e
clang::ASTContext::getFunctionTypeInternal(clang::QualType,
llvm::ArrayRef<clang::QualType>, clang::FunctionProtoType::ExtProtoInfo const&,
bool) const (/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x3fa054e)
 #5 0x0000562afe52800a
clang::ASTContext::getFunctionTypeWithExceptionSpec(clang::QualType,
clang::FunctionProtoType::ExceptionSpecInfo const&)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x3fa100a)
 #6 0x0000562afe52820f
clang::ASTContext::adjustExceptionSpec(clang::FunctionDecl*,
clang::FunctionProtoType::ExceptionSpecInfo const&, bool)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x3fa120f)
 #7 0x0000562afe0ae5a1 clang::Sema::UpdateExceptionSpec(clang::FunctionDecl*,
clang::FunctionProtoType::ExceptionSpecInfo const&)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x3b275a1)
 #8 0x0000562afe3b558e clang::Sema::SubstExceptionSpec(clang::FunctionDecl*,
clang::FunctionProtoType const*, clang::MultiLevelTemplateArgumentList const&)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x3e2e58e)
 #9 0x0000562afe3d5fae
clang::TemplateDeclInstantiator::InitFunctionInstantiation(clang::FunctionDecl*,
clang::FunctionDecl*)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x3e4efae)
#10 0x0000562afe3d62b6
clang::TemplateDeclInstantiator::InitMethodInstantiation(clang::CXXMethodDecl*,
clang::CXXMethodDecl*)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x3e4f2b6)
#11 0x0000562afe3df38d
clang::TemplateDeclInstantiator::VisitCXXMethodDecl(clang::CXXMethodDecl*,
clang::TemplateParameterList*, bool)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x3e5838d)
#12 0x0000562afe3dc44d clang::Sema::SubstDecl(clang::Decl*,
clang::DeclContext*, clang::MultiLevelTemplateArgumentList const&)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x3e5544d)
#13 0x0000562afe396483
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 ()>)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x3e0f483)
#14 0x0000562afe397666
clang::Sema::DeduceTemplateArguments(clang::FunctionTemplateDecl*,
clang::TemplateArgumentListInfo*, clang::QualType, clang::FunctionDecl*&,
clang::sema::TemplateDeductionInfo&, bool)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x3e10666)
#15 0x0000562afe32842a
clang::Sema::CheckFunctionTemplateSpecialization(clang::FunctionDecl*,
clang::TemplateArgumentListInfo*, clang::LookupResult&, bool)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x3da142a)
#16 0x0000562afdfa1de0 clang::Sema::ActOnFunctionDeclarator(clang::Scope*,
clang::Declarator&, clang::DeclContext*, clang::TypeSourceInfo*,
clang::LookupResult&, llvm::MutableArrayRef<clang::TemplateParameterList*>,
bool&) (/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x3a1ade0)
#17 0x0000562afdfa2e01 clang::Sema::HandleDeclarator(clang::Scope*,
clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x3a1be01)
#18 0x0000562afdfa5c98 clang::Sema::ActOnStartOfFunctionDef(clang::Scope*,
clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>,
clang::Sema::SkipBodyInfo*)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x3a1ec98)
#19 0x0000562afddaa272
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x3823272)
#20 0x0000562afde4c982
clang::Parser::ParseSingleDeclarationAfterTemplate(clang::DeclaratorContext,
clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&,
clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x38c5982)
#21 0x0000562afde4dc2f
clang::Parser::ParseTemplateDeclarationOrSpecialization(clang::DeclaratorContext,
clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x38c6c2f)
#22 0x0000562afde4e174
clang::Parser::ParseDeclarationStartingWithTemplate(clang::DeclaratorContext,
clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x38c7174)
#23 0x0000562afddd0cd5
clang::Parser::ParseDeclaration(clang::DeclaratorContext,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x3849cd5)
#24 0x0000562afddac9f2
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x38259f2)
#25 0x0000562afddad551
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x3826551)
#26 0x0000562afdda12d7 clang::ParseAST(clang::Sema&, bool, bool)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x381a2d7)
#27 0x0000562afd624107 clang::CodeGenAction::ExecuteAction()
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x309d107)
#28 0x0000562afd0634d6 clang::FrontendAction::Execute()
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x2adc4d6)
#29 0x0000562afd02509c
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x2a9e09c)
#30 0x0000562afd11c0c3
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0x2b950c3)
#31 0x0000562afb08d4b8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0xb064b8)
#32 0x0000562afafd2019 main
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0xa4b019)
#33 0x00007f33abdf80b3 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x270b3)
#34 0x0000562afb08a70a _start
(/opt/compiler-explorer/clang-8.0.1/bin/clang-8+0xb0370a)
clang-8: error: unable to execute command: Segmentation fault (core dumped)
clang-8: error: clang frontend command failed due to signal (use -v to see
invocation)
Compiler returned: 254

-- 
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/20210722/f26ff5b0/attachment.html>


More information about the llvm-bugs mailing list