[LLVMbugs] [Bug 11665] New: Crash accessing field of union explicitly initialized by calling the default constructor
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Dec 27 18:02:08 PST 2011
http://llvm.org/bugs/show_bug.cgi?id=11665
Bug #: 11665
Summary: Crash accessing field of union explicitly initialized
by calling the default constructor
Product: clang
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++0x
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: jwalden+llvm at mit.edu
CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
Classification: Unclassified
[jwalden at wheres-wally plugin-ice]$ cat minimal.ii
void f()
{
union U { int field; } u = U();
(void)U().field;
}
[jwalden at wheres-wally plugin-ice]$
~/Programs/clang-build/build/Release/bin/clang++ -std=c++11 minimal.ii
0 clang 0x0000000001b5a42f
1 clang 0x0000000001b5a899
2 libpthread.so.0 0x000000358f00eef0
3 clang 0x00000000008035fd
clang::CodeGen::CodeGenFunction::EmitAutoVarInit(clang::CodeGen::CodeGenFunction::AutoVarEmission
const&) + 381
4 clang 0x00000000008086c1
clang::CodeGen::CodeGenFunction::EmitAutoVarDecl(clang::VarDecl const&) + 33
5 clang 0x000000000089261f
clang::CodeGen::CodeGenFunction::EmitDeclStmt(clang::DeclStmt const&) + 95
6 clang 0x00000000008988b7
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 87
7 clang 0x0000000000895c13
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 35
8 clang 0x00000000008986ef
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&,
bool, clang::CodeGen::AggValueSlot) + 239
9 clang 0x0000000000898963
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 259
10 clang 0x0000000000895c13
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 35
11 clang 0x00000000008a5f6c
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 380
12 clang 0x00000000007b23bb
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl)
+ 427
13 clang 0x00000000007b2df3
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 371
14 clang 0x00000000007b331d
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) + 1277
15 clang 0x00000000007b3ceb
16 clang 0x000000000079eeec
17 clang 0x000000000079e6b7
18 clang 0x00000000008c54a4 clang::ParseAST(clang::Sema&, bool) + 292
19 clang 0x000000000067acfd
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 317
20 clang 0x0000000000661a2a
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1114
21 clang 0x00000000006580ba cc1_main(char const**, char const**, char
const*, void*) + 826
22 clang 0x0000000000643176 main + 678
23 libc.so.6 0x000000358ec2139d __libc_start_main + 237
24 clang 0x0000000000657c2d
Stack dump:
0. Program arguments:
/home/jwalden/Programs/clang-build/build/Release/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-disable-llvm-verifier -main-file-name minimal.ii -mrelocation-model static
-mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables
-target-cpu x86-64 -target-linker-version 2.21.51.0.6 -momit-leaf-frame-pointer
-resource-dir
/home/jwalden/Programs/clang-build/build/Release/bin/../lib/clang/3.1
-std=c++11 -fdeprecated-macro -fdebug-compilation-dir /tmp/plugin-ice
-ferror-limit 19 -fmessage-length 143 -mstackrealign -fgnu-runtime
-fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/minimal-TRoJXc.o -x c++-cpp-output minimal.ii
1. <eof> parser at end of file
2. minimal.ii:1:6: LLVM IR generation of declaration 'f'
3. minimal.ii:1:6: Generating code for declaration 'f'
4. minimal.ii:2:1: LLVM IR generation of compound statement ('{}')
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang: note: diagnostic msg: Please submit a bug report to
http://llvm.org/bugs/ and include command line arguments and all diagnostic
information.
clang: note: diagnostic msg: Error generating preprocessed source(s) - no
preprocessable inputs.
[jwalden at wheres-wally plugin-ice]$ (cd ~/Programs/clang-build/llvm/ && svn info
&& cd ~/Programs/clang-build/llvm/tools/clang/ && svn info; )
Path: .
URL: http://llvm.org/svn/llvm-project/llvm/trunk
Repository Root: http://llvm.org/svn/llvm-project
Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
Revision: 147303
Node Kind: directory
Schedule: normal
Last Changed Author: rafael
Last Changed Rev: 147296
Last Changed Date: 2011-12-27 15:37:11 -0600 (Tue, 27 Dec 2011)
Path: .
URL: http://llvm.org/svn/llvm-project/cfe/trunk
Repository Root: http://llvm.org/svn/llvm-project
Repository UUID: 91177308-0d34-0410-b5e6-96231b3b80d8
Revision: 147303
Node Kind: directory
Schedule: normal
Last Changed Author: dgregor
Last Changed Rev: 147299
Last Changed Date: 2011-12-27 16:43:10 -0600 (Tue, 27 Dec 2011)
--
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