[llvm-bugs] [Bug 45250] New: [regression] clang crashes in Sema/SemaType.cpp:5689
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Mar 19 07:47:51 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=45250
Bug ID: 45250
Summary: [regression] clang crashes in Sema/SemaType.cpp:5689
Product: clang
Version: 10.0
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Frontend
Assignee: unassignedclangbugs at nondot.org
Reporter: tangyixuan at mail.dlut.edu.cn
CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
richard-llvm at metafoo.co.uk
This is a test for fix for PR43315. However crashes clang recently.
$ cat 1.cpp
#define a __attribute__((__cdecl__, __regparm__(0)))
int(a b)();
$ clang++ -c -std=c++2a 1.cpp
clang-9: /home/oscar/compiler/llvm-project/clang/lib/Sema/SemaType.cpp:5689:
void
{anonymous}::DeclaratorLocFiller::VisitFunctionTypeLoc(clang::FunctionTypeLoc):
Assertion `Chunk.Kind == DeclaratorChunk::Function' failed.
Stack dump:
0. Program arguments: /usr/local/bin/clang-9 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
1.cpp -mrelocation-model static -mthread-model posix -mframe-pointer=all
-fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables
-fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb
-resource-dir /usr/local/lib/clang/10.0.0 -internal-isystem
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0
-internal-isystem
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/x86_64-pc-linux-gnu
-internal-isystem
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/local/lib/clang/10.0.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir
/media/oscar/xuaner1/autogeneration/testsuitC++/compileinformation/clang-9.0..1-crash-testsuit/clang
-ferror-limit 19 -fmessage-length 0 -fgnuc-version=4.2.1 -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-faddrsig -o 1.o -x c++ 1.cpp
1. 1.cpp:2:11: current parser token ';'
#0 0x000055fe5939105f llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/oscar/compiler/llvm-project/llvm/lib/Support/Unix/Signals.inc:544:0
#1 0x000055fe593910f2 PrintStackTraceSignalHandler(void*)
/home/oscar/compiler/llvm-project/llvm/lib/Support/Unix/Signals.inc:605:0
#2 0x000055fe5938ef55 llvm::sys::RunSignalHandlers()
/home/oscar/compiler/llvm-project/llvm/lib/Support/Signals.cpp:68:0
#3 0x000055fe593909ea SignalHandler(int)
/home/oscar/compiler/llvm-project/llvm/lib/Support/Unix/Signals.inc:391:0
#4 0x00007f7e431cc890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
#5 0x00007f7e422c4e97 raise (/lib/x86_64-linux-gnu/libc.so.6+0x3ee97)
#6 0x00007f7e422c6801 abort (/lib/x86_64-linux-gnu/libc.so.6+0x40801)
#7 0x00007f7e422b639a (/lib/x86_64-linux-gnu/libc.so.6+0x3039a)
#8 0x00007f7e422b6412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
#9 0x000055fe5c98cfad (anonymous
namespace)::DeclaratorLocFiller::VisitFunctionTypeLoc(clang::FunctionTypeLoc)
/home/oscar/compiler/llvm-project/clang/lib/Sema/SemaType.cpp:5690:0
#10 0x000055fe5c99a7c3 clang::TypeLocVisitor<(anonymous
namespace)::DeclaratorLocFiller,
void>::VisitFunctionProtoTypeLoc(clang::FunctionProtoTypeLoc)
/home/oscar/compiler/llvm-project/build/tools/clang/include/clang/AST/TypeNodes.inc:44:0
#11 0x000055fe5c998cd9 clang::TypeLocVisitor<(anonymous
namespace)::DeclaratorLocFiller, void>::Visit(clang::UnqualTypeLoc)
/home/oscar/compiler/llvm-project/build/tools/clang/include/clang/AST/TypeNodes.inc:44:0
#12 0x000055fe5c98d7c7 GetTypeSourceInfoForDeclarator((anonymous
namespace)::TypeProcessingState&, clang::QualType, clang::TypeSourceInfo*)
/home/oscar/compiler/llvm-project/clang/lib/Sema/SemaType.cpp:5814:0
#13 0x000055fe5c98b098 GetFullTypeForDeclarator((anonymous
namespace)::TypeProcessingState&, clang::QualType, clang::TypeSourceInfo*)
/home/oscar/compiler/llvm-project/clang/lib/Sema/SemaType.cpp:5278:0
#14 0x000055fe5c98b1a9 clang::Sema::GetTypeForDeclarator(clang::Declarator&,
clang::Scope*)
/home/oscar/compiler/llvm-project/clang/lib/Sema/SemaType.cpp:5296:0
#15 0x000055fe5bfc5be1 clang::Sema::HandleDeclarator(clang::Scope*,
clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>)
/home/oscar/compiler/llvm-project/clang/lib/Sema/SemaDecl.cpp:5615:0
#16 0x000055fe5bfc4bb7 clang::Sema::ActOnDeclarator(clang::Scope*,
clang::Declarator&)
/home/oscar/compiler/llvm-project/clang/lib/Sema/SemaDecl.cpp:5403:0
#17 0x000055fe5bd6927e
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
/home/oscar/compiler/llvm-project/clang/lib/Parse/ParseDecl.cpp:2281:0
#18 0x000055fe5bd6890b clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*)
/home/oscar/compiler/llvm-project/clang/lib/Parse/ParseDecl.cpp:2126:0
#19 0x000055fe5bd4a4c5
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
/home/oscar/compiler/llvm-project/clang/lib/Parse/Parser.cpp:1096:0
#20 0x000055fe5bd4a59f
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
/home/oscar/compiler/llvm-project/clang/lib/Parse/Parser.cpp:1111:0
#21 0x000055fe5bd49aff
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
/home/oscar/compiler/llvm-project/clang/lib/Parse/Parser.cpp:931:0
#22 0x000055fe5bd48d5c
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool)
/home/oscar/compiler/llvm-project/clang/lib/Parse/Parser.cpp:682:0
#23 0x000055fe5bd487f7
clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
/home/oscar/compiler/llvm-project/clang/lib/Parse/Parser.cpp:560:0
#24 0x000055fe5bd44ade clang::ParseAST(clang::Sema&, bool, bool)
/home/oscar/compiler/llvm-project/clang/lib/Parse/ParseAST.cpp:157:0
#25 0x000055fe59e1433b clang::ASTFrontendAction::ExecuteAction()
/home/oscar/compiler/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1042:0
#26 0x000055fe5a6bdbe2 clang::CodeGenAction::ExecuteAction()
/home/oscar/compiler/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:1089:0
#27 0x000055fe59e13c9c clang::FrontendAction::Execute()
/home/oscar/compiler/llvm-project/clang/lib/Frontend/FrontendAction.cpp:939:0
#28 0x000055fe59dabf17
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/home/oscar/compiler/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:956:0
#29 0x000055fe59f7ba9b
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/home/oscar/compiler/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:290:0
#30 0x000055fe56a680bf cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) /home/oscar/compiler/llvm-project/clang/tools/driver/cc1_main.cpp:250:0
#31 0x000055fe56a5d613 ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef)
/home/oscar/compiler/llvm-project/clang/tools/driver/driver.cpp:309:0
#32 0x000055fe56a5dd09 main
/home/oscar/compiler/llvm-project/clang/tools/driver/driver.cpp:382:0
#33 0x00007f7e422a7b97 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21b97)
#34 0x000055fe56a5bdea _start (/usr/local/bin/clang-9+0x2b39dea)
clang-9: error: unable to execute command: Aborted (core dumped)
clang-9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 10.0.0 (https://github.com/llvm/llvm-project.git
722b61892454b3217d73ec486e52156c5a92b5b3)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-9: note: diagnostic msg: PLEASE submit a bug report to
https://bugs.llvm.org/ and include the crash backtrace, preprocessed source,
and associated run script.
clang-9: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-9: note: diagnostic msg: /tmp/1-7bfe14.cpp
clang-9: note: diagnostic msg: /tmp/1-7bfe14.sh
clang-9: 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/20200319/728bd7a8/attachment-0001.html>
More information about the llvm-bugs
mailing list