[LLVMbugs] [Bug 8588] New: Clang crashes when using __attribute__((alias("")))

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Nov 11 11:37:20 PST 2010


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

           Summary: Clang crashes when using __attribute__((alias("")))
           Product: clang
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: js-llvm-bugzilla at webkeks.org
                CC: llvmbugs at cs.uiuc.edu


avalon:/tmp$ cat test.m
extern void *foo __attribute__((alias("OBJC_CLASS_$_Foo")));

@interface Foo
@end

@implementation Foo
@end

avalon:/tmp$ clang -c test.m
Assertion failed: (C->getType() == T->getElementType(I-V.begin()) &&
"Initializer for struct element doesn't match struct element type!"), function
ConstantStruct, file Constants.cpp, line 555.
0  clang             0x0000000101404ae2 std::vector<llvm::sys::Path,
std::allocator<llvm::sys::Path>
>::_M_insert_aux(__gnu_cxx::__normal_iterator<llvm::sys::Path*,
std::vector<llvm::sys::Path, std::allocator<llvm::sys::Path> > >,
llvm::sys::Path const&) + 11746
1  clang             0x0000000101405933 std::vector<llvm::sys::Path,
std::allocator<llvm::sys::Path>
>::_M_insert_aux(__gnu_cxx::__normal_iterator<llvm::sys::Path*,
std::vector<llvm::sys::Path, std::allocator<llvm::sys::Path> > >,
llvm::sys::Path const&) + 15411
2  libSystem.B.dylib 0x00007fff8782c67a _sigtramp + 26
3  libSystem.B.dylib 0x0000000000000038 _sigtramp + 2021472728
4  clang             0x0000000100017862
std::vector<llvm::PassRegistrationListener*,
std::allocator<llvm::PassRegistrationListener*>
>::_M_insert_aux(__gnu_cxx::__normal_iterator<llvm::PassRegistrationListener**,
std::vector<llvm::PassRegistrationListener*,
std::allocator<llvm::PassRegistrationListener*> > >,
llvm::PassRegistrationListener* const&) + 4274
5  clang             0x00000001012840c0 llvm::cast_retty<llvm::StructType,
llvm::CompositeType const*>::ret_type llvm::cast<llvm::StructType,
llvm::CompositeType const*>(llvm::CompositeType const* const&) + 14720
6  clang             0x000000010129d89e
llvm::ConstantUniqueMap<std::vector<llvm::Constant*,
std::allocator<llvm::Constant*> >, llvm::StructType, llvm::ConstantStruct,
true>::Create(llvm::StructType const*, std::vector<llvm::Constant*,
std::allocator<llvm::Constant*> > const&,
std::_Rb_tree_iterator<std::pair<std::pair<llvm::StructType const*,
std::vector<llvm::Constant*, std::allocator<llvm::Constant*> > > const,
llvm::ConstantStruct*> >) + 78
7  clang             0x00000001012896ce llvm::cast_retty<llvm::StructType,
llvm::CompositeType const*>::ret_type llvm::cast<llvm::StructType,
llvm::CompositeType const*>(llvm::CompositeType const* const&) + 36750
8  clang             0x0000000100242b34 llvm::IRBuilder<true,
llvm::ConstantFolder, llvm::IRBuilderDefaultInserter<true>
>::CreateStructGEP(llvm::Value*, unsigned int, llvm::Twine const&) + 70484
9  clang             0x0000000100257878 llvm::IRBuilder<true,
llvm::ConstantFolder, llvm::IRBuilderDefaultInserter<true>
>::CreateStructGEP(llvm::Value*, unsigned int, llvm::Twine const&) + 155800
10 clang             0x00000001002a4076 llvm::DenseMap<clang::Expr const*,
llvm::Value*, llvm::DenseMapInfo<clang::Expr const*>,
llvm::DenseMapInfo<llvm::Value*> >::grow(unsigned int) + 46182
11 clang             0x00000001002c62cc
llvm::SmallVectorTemplateBase<llvm::APInt, false>::grow(unsigned long) + 1468
12 clang             0x000000010028d98b
clang::ASTRecordLayout::getVBaseClassOffsetInBits(clang::CXXRecordDecl const*)
const + 2043
13 clang             0x00000001002d24e6 llvm::GetElementPtrInst*
llvm::GetElementPtrInst::CreateInBounds<llvm::Value**>(llvm::Value*,
llvm::Value**, llvm::Value**, llvm::Twine const&, llvm::Instruction*) + 710
14 clang             0x000000010028e20c
clang::ASTRecordLayout::getVBaseClassOffsetInBits(clang::CXXRecordDecl const*)
const + 4220
15 clang             0x000000010004e319 llvm::DenseMap<clang::IdentifierInfo
const*, unsigned int, llvm::DenseMapInfo<clang::IdentifierInfo const*>,
llvm::DenseMapInfo<unsigned int> >::grow(unsigned int) + 7849
16 clang             0x000000010002114e llvm::raw_ostream::operator<<(char
const*) + 1742
17 clang             0x0000000100019175
std::vector<llvm::PassRegistrationListener*,
std::allocator<llvm::PassRegistrationListener*>
>::_M_insert_aux(__gnu_cxx::__normal_iterator<llvm::PassRegistrationListener**,
std::vector<llvm::PassRegistrationListener*,
std::allocator<llvm::PassRegistrationListener*> > >,
llvm::PassRegistrationListener* const&) + 10693
18 clang             0x00000001000200d4 std::vector<std::string,
std::allocator<std::string> >::operator=(std::vector<std::string,
std::allocator<std::string> > const&) + 11604
19 clang             0x0000000100017b38
std::vector<llvm::PassRegistrationListener*,
std::allocator<llvm::PassRegistrationListener*>
>::_M_insert_aux(__gnu_cxx::__normal_iterator<llvm::PassRegistrationListener**,
std::vector<llvm::PassRegistrationListener*,
std::allocator<llvm::PassRegistrationListener*> > >,
llvm::PassRegistrationListener* const&) + 5000
Stack dump:
0.    Program arguments: /usr/local/bin/clang -cc1 -triple
x86_64-apple-darwin10.0.0 -emit-obj -mrelax-all -disable-free -main-file-name
test.m -pic-level 1 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu
core2 -target-linker-version 97.14 -resource-dir
/usr/local/bin/../lib/clang/2.9 -ferror-limit 19 -fmessage-length 80
-stack-protector 1 -fblocks -fexceptions -fobjc-nonfragile-abi2
-fobjc-dispatch-method=mixed -fdiagnostics-show-option -fcolor-diagnostics -o
test.o -x objective-c test.m 
1.    <eof> parser at end of file
2.    test.m:6:1: LLVM IR generation of declaration 'Foo'
clang: error: unable to execute command: Illegal instruction
clang: error: clang frontend command failed due to signal 1 (use -v to see
invocation)

-- 
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