[llvm-bugs] [Bug 31969] New: Assertion failure in DeclBase.cpp

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Feb 15 05:25:40 PST 2017


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

            Bug ID: 31969
           Summary: Assertion failure in DeclBase.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 17984
  --> http://bugs.llvm.org/attachment.cgi?id=17984&action=edit
Preprocessed test case.

Compiling the attached preprocessed source file with the command line in the
attached driver file produces this assertion failure:

clang-4.0: /work/sources/llvm/current/tools/clang/lib/AST/DeclBase.cpp:111:
void clang::Decl::setInvalidDecl(bool): Assertion `!isa<TagDecl>(this) ||
!cast<TagDecl>(this)->isCompleteDefinition()' failed.

The stack backtrace looks like this:

#0 0x00000000034cc20c llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/work/sources/llvm/current/lib/Support/Unix/Signals.inc:402:0
#1 0x00000000034cc29f PrintStackTraceSignalHandler(void*)
/work/sources/llvm/current/lib/Support/Unix/Signals.inc:466:0
#2 0x00000000034ca802 llvm::sys::RunSignalHandlers()
/work/sources/llvm/current/lib/Support/Signals.cpp:44:0
#3 0x00000000034cbb83 SignalHandler(int)
/work/sources/llvm/current/lib/Support/Unix/Signals.inc:256:0
#4 0x00007f4d8c3bd5c0 __restore_rt (/lib64/libpthread.so.0+0x115c0)
#5 0x00007f4d8af2591f __GI_raise
/usr/src/debug/glibc-2.24-33-ge9e69e4/signal/../sysdeps/unix/sysv/linux/raise.c:58:0
#6 0x00007f4d8af2751a __GI_abort
/usr/src/debug/glibc-2.24-33-ge9e69e4/stdlib/abort.c:91:0
#7 0x00007f4d8af1dda7 __assert_fail_base
/usr/src/debug/glibc-2.24-33-ge9e69e4/assert/assert.c:92:0
#8 0x00007f4d8af1de52 (/lib64/libc.so.6+0x2de52)
#9 0x00000000060f27b0 clang::Decl::setInvalidDecl(bool)
/work/sources/llvm/current/tools/clang/lib/AST/DeclBase.cpp:111:0
#10 0x000000000567b2ef clang::Sema::ActOnForStmt(clang::SourceLocation,
clang::SourceLocation, clang::Stmt*, clang::Sema::ConditionResult,
clang::Sema::FullExprArg, clang::SourceLocation, clang::Stmt*)
/work/sources/llvm/current/tools/clang/lib/Sema/SemaStmt.cpp:1640:0
#11 0x0000000004dfb559 clang::Parser::ParseForStatement(clang::SourceLocation*)
/work/sources/llvm/current/tools/clang/lib/Parse/ParseStmt.cpp:1805:0
#12 0x0000000004df5db8
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::AllowedContsructsKind, clang::SourceLocation*,
clang::Parser::ParsedAttributesWithRange&)
/work/sources/llvm/current/tools/clang/lib/Parse/ParseStmt.cpp:250:0
#13 0x0000000004df55f8
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, clang::Parser::AllowedContsructsKind, clang::SourceLocation*)
/work/sources/llvm/current/tools/clang/lib/Parse/ParseStmt.cpp:111:0
#14 0x0000000004df8787 clang::Parser::ParseCompoundStatementBody(bool)
/work/sources/llvm/current/tools/clang/lib/Parse/ParseStmt.cpp:987:0
#15 0x0000000004dfbe5b clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&)
/work/sources/llvm/current/tools/clang/lib/Parse/ParseStmt.cpp:1951:0
#16 0x0000000004d571ef
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
/work/sources/llvm/current/tools/clang/lib/Parse/Parser.cpp:1218:0
#17 0x0000000004d73353 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 0x0000000004d562ca
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
/work/sources/llvm/current/tools/clang/lib/Parse/Parser.cpp:986:0
#19 0x0000000004d56382
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
/work/sources/llvm/current/tools/clang/lib/Parse/Parser.cpp:1001:0
#20 0x0000000004d55a05
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
/work/sources/llvm/current/tools/clang/lib/Parse/Parser.cpp:851:0
#21 0x0000000004d54cef
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
/work/sources/llvm/current/tools/clang/lib/Parse/Parser.cpp:627:0
#22 0x0000000004d5497e
clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
/work/sources/llvm/current/tools/clang/lib/Parse/Parser.cpp:561:0
#23 0x0000000004d50de7 clang::ParseAST(clang::Sema&, bool, bool)
/work/sources/llvm/current/tools/clang/lib/Parse/ParseAST.cpp:146:0
#24 0x0000000003d0e575 clang::ASTFrontendAction::ExecuteAction()
/work/sources/llvm/current/tools/clang/lib/Frontend/FrontendAction.cpp:568:0
#25 0x000000000415de26 clang::CodeGenAction::ExecuteAction()
/work/sources/llvm/current/tools/clang/lib/CodeGen/CodeGenAction.cpp:973:0
#26 0x0000000003d0dfe3 clang::FrontendAction::Execute()
/work/sources/llvm/current/tools/clang/lib/Frontend/FrontendAction.cpp:472:0
#27 0x0000000003cb39a5
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/work/sources/llvm/current/tools/clang/lib/Frontend/CompilerInstance.cpp:951:0
#28 0x0000000003e3b18b
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/work/sources/llvm/current/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:249:0
#29 0x0000000001868da7 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) /work/sources/llvm/current/tools/clang/tools/driver/cc1_main.cpp:221:0
#30 0x000000000185eb5f ExecuteCC1Tool(llvm::ArrayRef<char const*>,
llvm::StringRef)
/work/sources/llvm/current/tools/clang/tools/driver/driver.cpp:299:0
#31 0x000000000185f6ee main
/work/sources/llvm/current/tools/clang/tools/driver/driver.cpp:380:0
#32 0x00007f4d8af10401 __libc_start_main
/usr/src/debug/glibc-2.24-33-ge9e69e4/csu/../csu/libc-start.c:323:0
#33 0x000000000185c55a _start
(/work/builds/llvm/current/native/bin/clang-4.0+0x185c55a)
Stack dump:
0.      Program arguments: /work/builds/llvm/current/native/bin/clang-4.0 -cc1
-triple x86_64-unknown-linux-gnu -emit-llvm -disable-free -main-file-name
c99-fordecl-2.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/llvm/current/native/tests/c99-fordecl-2.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
-std=iso9899:1999 -fdebug-compilation-dir
/work/builds/llvm/current/native/tests -ferror-limit 19 -fmessage-length 130
-fobjc-runtime=gcc -fdiagnostics-show-option -o c99-fordecl-2.s -x c
/work/sources/gcc/current/gcc/testsuite/gcc.dg/c99-fordecl-2.c 
1.      /work/sources/gcc/current/gcc/testsuite/gcc.dg/c99-fordecl-2.c:24:3:
current parser token 'for'
2.      /work/sources/gcc/current/gcc/testsuite/gcc.dg/c99-fordecl-2.c:8:1:
parsing function body 'foo'
3.      /work/sources/gcc/current/gcc/testsuite/gcc.dg/c99-fordecl-2.c:8:1: in
compound statement ('{}')

-- 
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/8e21009d/attachment-0001.html>


More information about the llvm-bugs mailing list