[llvm-bugs] [Bug 31968] New: Assertion failure in Type.cpp

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Feb 15 05:20:34 PST 2017


http://bugs.llvm.org/show_bug.cgi?id=31968

            Bug ID: 31968
           Summary: Assertion failure in Type.cpp
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nickc at redhat.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 17982
  --> http://bugs.llvm.org/attachment.cgi?id=17982&action=edit
Preprocessed test case.

Compiling the attached preprocessed source code with the attached command line
results in this assertion failure:

clang-4.0: /work/sources/llvm/current/tools/clang/lib/AST/Type.cpp:2715:
clang::FunctionProtoType::FunctionProtoType(clang::QualType,
llvm::ArrayRef<clang::QualType>, clang::QualType, const
clang::FunctionProtoType::ExtProtoInfo&): Assertion `NumParams == params.size()
&& "function has too many parameters"' failed.

The stack backtrace looks like this:

#0 0x00000000034418e4 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/work/sources/llvm/current/lib/Support/Unix/Signals.inc:402:0
#1 0x0000000003441977 PrintStackTraceSignalHandler(void*)
/work/sources/llvm/current/lib/Support/Unix/Signals.inc:466:0
#2 0x000000000343feda llvm::sys::RunSignalHandlers()
/work/sources/llvm/current/lib/Support/Signals.cpp:44:0
#3 0x000000000344125b SignalHandler(int)
/work/sources/llvm/current/lib/Support/Unix/Signals.inc:256:0
#4 0x00007fca7d9345c0 __restore_rt (/lib64/libpthread.so.0+0x115c0)
#5 0x00007fca7c49c91f __GI_raise
/usr/src/debug/glibc-2.24-33-ge9e69e4/signal/../sysdeps/unix/sysv/linux/raise.c:58:0
#6 0x00007fca7c49e51a __GI_abort
/usr/src/debug/glibc-2.24-33-ge9e69e4/stdlib/abort.c:91:0
#7 0x00007fca7c494da7 __assert_fail_base
/usr/src/debug/glibc-2.24-33-ge9e69e4/assert/assert.c:92:0
#8 0x00007fca7c494e52 (/lib64/libc.so.6+0x2de52)
#9 0x00000000061d6e91
clang::FunctionProtoType::FunctionProtoType(clang::QualType,
llvm::ArrayRef<clang::QualType>, clang::QualType,
clang::FunctionProtoType::ExtProtoInfo const&)
/work/sources/llvm/current/tools/clang/lib/AST/Type.cpp:2715:0
#10 0x0000000005f1de34
clang::ASTContext::getFunctionTypeInternal(clang::QualType,
llvm::ArrayRef<clang::QualType>, clang::FunctionProtoType::ExtProtoInfo const&,
bool) const
/work/sources/llvm/current/tools/clang/lib/AST/ASTContext.cpp:3350:0
#11 0x0000000003692650 clang::ASTContext::getFunctionType(clang::QualType,
llvm::ArrayRef<clang::QualType>, clang::FunctionProtoType::ExtProtoInfo const&)
const
/work/sources/llvm/current/tools/clang/include/clang/AST/ASTContext.h:1274:0
#12 0x000000000580fb13 GetFullTypeForDeclarator((anonymous
namespace)::TypeProcessingState&, clang::QualType, clang::TypeSourceInfo*)
/work/sources/llvm/current/tools/clang/lib/Sema/SemaType.cpp:4522:0
#13 0x0000000005810c32 clang::Sema::GetTypeForDeclarator(clang::Declarator&,
clang::Scope*)
/work/sources/llvm/current/tools/clang/lib/Sema/SemaType.cpp:4806:0
#14 0x00000000050d6b18 clang::Sema::HandleDeclarator(clang::Scope*,
clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>)
/work/sources/llvm/current/tools/clang/lib/Sema/SemaDecl.cpp:5097:0
#15 0x00000000050f1eb2 clang::Sema::ActOnStartOfFunctionDef(clang::Scope*,
clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>,
clang::Sema::SkipBodyInfo*)
/work/sources/llvm/current/tools/clang/lib/Sema/SemaDecl.cpp:11564:0
#16 0x0000000004cd232e
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
/work/sources/llvm/current/tools/clang/lib/Parse/Parser.cpp:1140:0
#17 0x0000000004ceea0b clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
unsigned int, clang::SourceLocation*, clang::Parser::ForRangeInit*)
/work/sources/llvm/current/tools/clang/lib/Parse/ParseDecl.cpp:1815:0
#18 0x0000000004cd1988
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
/work/sources/llvm/current/tools/clang/lib/Parse/Parser.cpp:986:0
#19 0x0000000004cd1a40
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
/work/sources/llvm/current/tools/clang/lib/Parse/Parser.cpp:1001:0
#20 0x0000000004cd10c3
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
/work/sources/llvm/current/tools/clang/lib/Parse/Parser.cpp:851:0
#21 0x0000000004cd03ad
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
/work/sources/llvm/current/tools/clang/lib/Parse/Parser.cpp:627:0
#22 0x0000000004cd003c
clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
/work/sources/llvm/current/tools/clang/lib/Parse/Parser.cpp:561:0
#23 0x0000000004ccc4a5 clang::ParseAST(clang::Sema&, bool, bool)
/work/sources/llvm/current/tools/clang/lib/Parse/ParseAST.cpp:146:0
#24 0x0000000003c7b9b9 clang::ASTFrontendAction::ExecuteAction()
/work/sources/llvm/current/tools/clang/lib/Frontend/FrontendAction.cpp:559:0
#25 0x00000000040df4a8 clang::CodeGenAction::ExecuteAction()
/work/sources/llvm/current/tools/clang/lib/CodeGen/CodeGenAction.cpp:959:0
#26 0x0000000003c7b427 clang::FrontendAction::Execute()
/work/sources/llvm/current/tools/clang/lib/Frontend/FrontendAction.cpp:463:0
#27 0x0000000003c20fa1
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/work/sources/llvm/current/tools/clang/lib/Frontend/CompilerInstance.cpp:951:0
#28 0x0000000003da81b5
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/work/sources/llvm/current/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:249:0
#29 0x0000000001828417 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) /work/sources/llvm/current/tools/clang/tools/driver/cc1_main.cpp:221:0
#30 0x000000000181e1cf ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef)
/work/sources/llvm/current/tools/clang/tools/driver/driver.cpp:299:0
#31 0x000000000181ed5e main
/work/sources/llvm/current/tools/clang/tools/driver/driver.cpp:380:0
#32 0x00007fca7c487401 __libc_start_main
/usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:323:0
#33 0x000000000181bbca _start
(/work/builds/llvm/current/native/bin/clang-4.0+0x181bbca)
Stack dump:
0.      Program arguments: /work/builds/llvm/current/native/bin/clang-4.0 -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name limits-fndefn.c -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
-debugger-tuning=gdb -coverage-notes-file
/work/builds/gcc/current/x86_64-pc-linux-gnu-gold/gcc/testsuite/gcc/limits-fndefn.gcno
-resource-dir /work/builds/llvm/current/native/bin/../lib/clang/5.0.0
-internal-isystem /usr/local/include -internal-isystem
/work/builds/llvm/current/native/bin/../lib/clang/5.0.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O0
-w -fdebug-compilation-dir
/work/builds/gcc/current/x86_64-pc-linux-gnu-gold/gcc/testsuite/gcc
-ferror-limit 19 -fmessage-length 80 -fobjc-runtime=gcc
-fdiagnostics-show-option -o limits-fndefn.o -x c
/work/sources/gcc/current/gcc/testsuite/gcc.c-torture/compile/limits-fndefn.c 
1.     
/work/sources/gcc/current/gcc/testsuite/gcc.c-torture/compile/limits-fndefn.c:19:1:
current parser token '{'

-- 
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/20170215/6281fcdd/attachment.html>


More information about the llvm-bugs mailing list