[llvm-bugs] [Bug 28021] New: clang crashes on valid C++11 code: Assertion `!isIncompleteType() && "This doesn't make sense for incomplete types"' failed

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 6 10:40:45 PDT 2016


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

            Bug ID: 28021
           Summary: clang crashes on valid C++11 code: Assertion
                    `!isIncompleteType() && "This doesn't make sense for
                    incomplete types"' failed
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: su at cs.ucdavis.edu
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

The current clang trunk crashes when compiling the following valid C++11 test
case on x86_64-linux-gnu in both 32-bit and 64-bit modes. 

This is a regression from 3.8.x.


$ clang++-trunk -v
clang version 3.9.0 (trunk 271803)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/tools/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$
$ clang++-3.8 -std=c++11 small.cpp
$
$ clang++-trunk -std=c++11 small.cpp
clang-3.9:
/tmp/llvm-builder/llvm-source-trunk/tools/clang/lib/AST/Type.cpp:1883: bool
clang::Type::isConstantSizeType() const: Assertion `!isIncompleteType() &&
"This doesn't make sense for incomplete types"' failed.
#0 0x0000000001e193b5 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/clang-trunk/bin/clang-3.9+0x1e193b5)
#1 0x0000000001e17346 llvm::sys::RunSignalHandlers()
(/usr/local/clang-trunk/bin/clang-3.9+0x1e17346)
#2 0x0000000001e17564 SignalHandler(int)
(/usr/local/clang-trunk/bin/clang-3.9+0x1e17564)
#3 0x00007fe28585d340 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10340)
#4 0x00007fe284a7bcc9 gsignal
/build/eglibc-3GlaMS/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007fe284a7f0d8 abort
/build/eglibc-3GlaMS/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007fe284a74b86 __assert_fail_base
/build/eglibc-3GlaMS/eglibc-2.19/assert/assert.c:92:0
#7 0x00007fe284a74c32 (/lib/x86_64-linux-gnu/libc.so.6+0x2fc32)
#8 0x00000000034dc21f clang::Type::isConstantSizeType() const
(/usr/local/clang-trunk/bin/clang-3.9+0x34dc21f)
#9 0x00000000020d7cce
clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(clang::VarDecl const&)
(/usr/local/clang-trunk/bin/clang-3.9+0x20d7cce)
#10 0x00000000020d87b7
clang::CodeGen::CodeGenFunction::EmitAutoVarDecl(clang::VarDecl const&)
(/usr/local/clang-trunk/bin/clang-3.9+0x20d87b7)
#11 0x0000000001f9ba0f
clang::CodeGen::CodeGenFunction::EmitDeclStmt(clang::DeclStmt const&)
(/usr/local/clang-trunk/bin/clang-3.9+0x1f9ba0f)
#12 0x0000000001fa7bb2
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*)
(/usr/local/clang-trunk/bin/clang-3.9+0x1fa7bb2)
#13 0x0000000001fa3f78 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*) (/usr/local/clang-trunk/bin/clang-3.9+0x1fa3f78)
#14 0x0000000001fa4cbf
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
(/usr/local/clang-trunk/bin/clang-3.9+0x1fa4cbf)
#15 0x0000000001fcab82
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&,
clang::Stmt const*) (/usr/local/clang-trunk/bin/clang-3.9+0x1fcab82)
#16 0x0000000001fd530e
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
(/usr/local/clang-trunk/bin/clang-3.9+0x1fd530e)
#17 0x0000000001ff6521
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/usr/local/clang-trunk/bin/clang-3.9+0x1ff6521)
#18 0x0000000002007901
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/usr/local/clang-trunk/bin/clang-3.9+0x2007901)
#19 0x0000000002007aa5 clang::CodeGen::CodeGenModule::EmitDeferred()
(/usr/local/clang-trunk/bin/clang-3.9+0x2007aa5)
#20 0x0000000002007c14 clang::CodeGen::CodeGenModule::Release()
(/usr/local/clang-trunk/bin/clang-3.9+0x2007c14)
#21 0x00000000025c5907 (anonymous
namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&)
(/usr/local/clang-trunk/bin/clang-3.9+0x25c5907)
#22 0x00000000025c0f42
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/usr/local/clang-trunk/bin/clang-3.9+0x25c0f42)
#23 0x000000000292294d clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/clang-trunk/bin/clang-3.9+0x292294d)
#24 0x00000000025c146e clang::CodeGenAction::ExecuteAction()
(/usr/local/clang-trunk/bin/clang-3.9+0x25c146e)
#25 0x000000000228e78e clang::FrontendAction::Execute()
(/usr/local/clang-trunk/bin/clang-3.9+0x228e78e)
#26 0x00000000022641f6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/clang-trunk/bin/clang-3.9+0x22641f6)
#27 0x000000000231b8f2
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/clang-trunk/bin/clang-3.9+0x231b8f2)
#28 0x0000000000aed738 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/clang-trunk/bin/clang-3.9+0xaed738)
#29 0x0000000000aa1e6e main (/usr/local/clang-trunk/bin/clang-3.9+0xaa1e6e)
#30 0x00007fe284a66ec5 __libc_start_main
/build/eglibc-3GlaMS/eglibc-2.19/csu/libc-start.c:321:0
#31 0x0000000000ae97a4 _start (/usr/local/clang-trunk/bin/clang-3.9+0xae97a4)
Stack dump:
0.      Program arguments: /usr/local/clang-trunk/bin/clang-3.9 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
small.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 -debugger-tuning=gdb
-resource-dir /usr/local/clang-trunk/bin/../lib/clang/3.9.0 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/x86_64-linux-gnu/c++/4.9
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/x86_64-linux-gnu/c++/4.9
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/local/clang-trunk/bin/../lib/clang/3.9.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 /data2 -ferror-limit 19 -fmessage-length 229
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/small-31e206.o -x c++ small.cpp
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
3.      small.cpp:5:6: Generating code for declaration 'test'
clang-3.9: error: unable to execute command: Aborted (core dumped)
clang-3.9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.9.0 (trunk 271803)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/tools/bin
clang-3.9: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-3.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-3.9: note: diagnostic msg: /tmp/small-0af137.cpp
clang-3.9: note: diagnostic msg: /tmp/small-0af137.sh
clang-3.9: note: diagnostic msg:

********************
$


---------------------------------------


template < class T >
T && create ();

template < class T, class ... Args >
void test ()
{ 
  T t (create < Args > ()...);
  (void) t;
}

int main ()
{ 
  test < int[] > ();
  return 0;
}

-- 
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/20160606/3c32e78e/attachment-0001.html>


More information about the llvm-bugs mailing list