[LLVMbugs] [Bug 7188] New: Virtual inheritance crashes clang++

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri May 21 06:36:37 PDT 2010


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

           Summary: Virtual inheritance crashes clang++
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: mmo at vizrt.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Created an attachment (id=4920)
 --> (http://llvm.org/bugs/attachment.cgi?id=4920)
Small contrived example which crashes clang++

The code (attached: crashes.cc) with virtual inheritance crashes clang++ with
the following stack trace:
$ clang++ crashes.cc -v
clang version 2.0 (trunk 104313)
Target: x86_64-unknown-linux-gnu
Thread model: posix
 "/usr/local/bin/clang" -cc1 -triple x86_64-unknown-linux-gnu -S -disable-free
-main-file-name crashes.cc -mrelocation-model static -mdisable-fp-elim
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -v -resource-dir
/usr/local/lib/clang/2.0 -ferror-limit 19 -fmessage-length 174 -fexceptions
-fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-Euw0c9.s
-x c++ crashes.cc
clang -cc1 version 2.0 based upon llvm 2.8svn hosted on
x86_64-unknown-linux-gnu
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/4.4
 /usr/include/c++/4.4/x86_64-linux-gnu
 /usr/include/c++/4.4/backward
 /usr/local/include
 /usr/local/lib/clang/2.0/include
 /usr/include
End of search list.
clang: CGExprAgg.cpp:766: void
clang::CodeGen::CodeGenFunction::EmitAggregateCopy(llvm::Value*, llvm::Value*,
clang::QualType, bool): Assertion `(Record->hasTrivialCopyConstructor() ||
Record->hasTrivialCopyAssignment()) && "Trying to aggregate-copy a type without
a trivial copy " "constructor or assignment operator"' failed.
0  clang           0x000000000129aedf
1  clang           0x000000000129d06a
2  libpthread.so.0 0x00007f7b43e948f0
3  libc.so.6       0x00007f7b43184a75 gsignal + 53
4  libc.so.6       0x00007f7b431885c0 abort + 384
5  libc.so.6       0x00007f7b4317d941 __assert_fail + 241
6  clang           0x0000000000576608
7  clang           0x00000000005766bd
8  clang           0x000000000057685a
9  clang           0x0000000000579242
10 clang           0x0000000000579968
11 clang           0x0000000000567210
12 clang           0x000000000056734e
13 clang           0x0000000000542921
14 clang           0x00000000005e6e8d
15 clang           0x00000000005e7dd3
16 clang           0x00000000005f1a6c
17 clang           0x000000000052728e
18 clang           0x00000000005274e0
19 clang           0x0000000000527599
20 clang           0x0000000000419125
21 clang           0x000000000061bf2f
22 clang           0x000000000041c461
23 clang           0x0000000000409d46
24 clang           0x000000000040fcd1 main + 3185
25 libc.so.6       0x00007f7b4316fc4d __libc_start_main + 253
26 clang           0x0000000000407629
Stack dump:
0.      Program arguments: /usr/local/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -S -disable-free -main-file-name crashes.cc
-mrelocation-model static -mdisable-fp-elim -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -v -resource-dir /usr/local/lib/clang/2.0
-ferror-limit 19 -fmessage-length 174 -fexceptions -fgnu-runtime
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-Euw0c9.s -x c++
crashes.cc 
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
3.      crashes.cc:23:10: Generating code for declaration 'foobarbaz::baz'
clang: error: compiler command failed due to signal 6 (use -v to see
invocation)


If instead bar takes std::string as an argument, and baz does not have any
arguments, the example compiles without problems.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list