[LLVMbugs] [Bug 5025] New: crash in objc messaging

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Sep 21 19:14:37 PDT 2009


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

           Summary: crash in objc messaging
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: daniel at zuster.org
                CC: llvmbugs at cs.uiuc.edu


This test case (originally from PR4894) is still crashing:
--
ddunbar at ozzy:CodeGenObjC (master)$ cat t.m
typedef const struct objc_selector {
  void *sel_id;
  const char *sel_types;
} *SEL;

@interface I2
+(id) dictionary;
@end

@implementation I3;
+(void) initialize {
  I2 *a0 = [I2 dictionary];
}
@end
ddunbar at ozzy:CodeGenObjC (master)$ clang -c t.m
t.m:11:17: warning: cannot find
      interface declaration for 'I3'
@implementation I3;
                ^
Assertion failed: (Result->getType() == Ty && "Type specified is not
correct!"), function Create, file
/Volumes/Data/ddunbar/llvm/lib/VMCore/ConstantsContext.h, line 607.
0   clang-cc          0x00000001010e3c35 PrintStackTrace(void*) + 38
1   clang-cc          0x00000001010e41c3 SignalHandler(int) + 336
2   libSystem.B.dylib 0x00007fff8584414a _sigtramp + 26
3   clang-cc          0x0000000100b7d9d5 llvm::APInt::operator==(llvm::APInt
const&) const + 81
4   libSystem.B.dylib 0x00007fff858c0104 __pthread_markcancel + 0
5   clang-cc          0x0000000100ff35fa llvm::ValueMap<llvm::ExprMapKeyType,
llvm::Type, llvm::ConstantExpr, false>::Create(llvm::Type const*,
llvm::ExprMapKeyType const&,
std::_Rb_tree_iterator<std::pair<std::pair<llvm::Type const*,
llvm::ExprMapKeyType> const, llvm::ConstantExpr*> >) + 172
6   clang-cc          0x0000000100ff37b2 llvm::ValueMap<llvm::ExprMapKeyType,
llvm::Type, llvm::ConstantExpr, false>::getOrCreate(llvm::Type const*,
llvm::ExprMapKeyType const&) + 248
7   clang-cc          0x0000000100fe7be0
getFoldedCast(llvm::Instruction::CastOps, llvm::Constant*, llvm::Type const*) +
382
8   clang-cc          0x0000000100fe7d0e
llvm::ConstantExpr::getBitCast(llvm::Constant*, llvm::Type const*) + 230
9   clang-cc          0x0000000100fe8a75 llvm::ConstantExpr::getCast(unsigned
int, llvm::Constant*, llvm::Type const*) + 587
10  clang-cc          0x0000000100fe9527
llvm::ConstantExpr::getPointerCast(llvm::Constant*, llvm::Type const*) + 235
11  clang-cc          0x0000000100fe206e
llvm::ConstantFoldCastInstruction(llvm::LLVMContext&, unsigned int,
llvm::Constant*, llvm::Type const*) + 499
12  clang-cc          0x0000000100fe7b11
getFoldedCast(llvm::Instruction::CastOps, llvm::Constant*, llvm::Type const*) +
175
13  clang-cc          0x0000000100fe7d0e
llvm::ConstantExpr::getBitCast(llvm::Constant*, llvm::Type const*) + 230
14  clang-cc          0x000000010016c087 (anonymous
namespace)::CGObjCNonFragileABIMac::EmitSelector(llvm::IRBuilder<true,
llvm::ConstantFolder, llvm::IRBuilderDefaultInserter<true> >&, clang::Selector)
+ 127
15  clang-cc          0x0000000100171c7b (anonymous
namespace)::CGObjCNonFragileABIMac::GenerateMessageSend(clang::CodeGen::CodeGenFunction&,
clang::QualType, clang::Selector, llvm::Value*, bool,
llvm::SmallVector<std::pair<clang::CodeGen::RValue, clang::QualType>, 16u>
const&, clang::ObjCMethodDecl const*) + 117
16  clang-cc          0x0000000100150e52
clang::CodeGen::CodeGenFunction::EmitObjCMessageExpr(clang::ObjCMessageExpr
const*) + 958
17  clang-cc          0x00000001001444e8 (anonymous
namespace)::ScalarExprEmitter::VisitObjCMessageExpr(clang::ObjCMessageExpr*) +
36
18  clang-cc          0x000000010014a13e clang::StmtVisitor<(anonymous
namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) + 4380
19  clang-cc          0x0000000100148cb3 (anonymous
namespace)::ScalarExprEmitter::EmitCastExpr(clang::Expr const*,
clang::QualType, clang::CastExpr::CastKind) + 1629
20  clang-cc          0x0000000100148ef8 (anonymous
namespace)::ScalarExprEmitter::VisitCastExpr(clang::CastExpr const*) + 128
21  clang-cc          0x0000000100148f1f clang::StmtVisitor<(anonymous
namespace)::ScalarExprEmitter,
llvm::Value*>::VisitImplicitCastExpr(clang::ImplicitCastExpr*) + 29
22  clang-cc          0x0000000100149ca7 clang::StmtVisitor<(anonymous
namespace)::ScalarExprEmitter, llvm::Value*>::Visit(clang::Stmt*) + 3205
23  clang-cc          0x000000010014a2b7
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 131
24  clang-cc          0x0000000100128320
clang::CodeGen::CodeGenFunction::EmitLocalBlockVarDecl(clang::VarDecl const&) +
2180
25  clang-cc          0x0000000100129375
clang::CodeGen::CodeGenFunction::EmitBlockVarDecl(clang::VarDecl const&) + 157
26  clang-cc          0x00000001001294de
clang::CodeGen::CodeGenFunction::EmitDecl(clang::Decl const&) + 310
27  clang-cc          0x0000000100181af9
clang::CodeGen::CodeGenFunction::EmitDeclStmt(clang::DeclStmt const&) + 101
28  clang-cc          0x0000000100183174
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 224
29  clang-cc          0x0000000100181ba6
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 78
30  clang-cc          0x0000000100182f47
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&,
bool, llvm::Value*, bool) + 301
31  clang-cc          0x000000010018315a
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 198
32  clang-cc          0x0000000100181ba6
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 78
33  clang-cc          0x0000000100150a7d
clang::CodeGen::CodeGenFunction::GenerateObjCMethod(clang::ObjCMethodDecl
const*) + 161
34  clang-cc          0x0000000100191d6f
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 955
35  clang-cc          0x00000001001a4d7c (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) + 76
36  clang-cc          0x0000000100046f63 (anonymous
namespace)::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) + 145
37  clang-cc          0x000000010027de82 clang::ParseAST(clang::Preprocessor&,
clang::ASTConsumer*, clang::ASTContext&, bool, bool,
clang::CodeCompleteConsumer* (*)(clang::Sema&, void*), void*) + 566
38  clang-cc          0x000000010003247c ProcessInputFile(clang::Preprocessor&,
clang::PreprocessorFactory&, std::string const&, ProgActions,
llvm::StringMap<bool, llvm::MallocAllocator> const&, llvm::LLVMContext&) + 3471
39  clang-cc          0x0000000100033b92 main + 3269
40  clang-cc          0x000000010002dc60 start + 52
41  clang-cc          0x0000000000000015 start + 4294779881
Stack dump:
0.      Program arguments: /Volumes/Data/ddunbar/llvm.obj.64/Debug/bin/clang-cc
-triple x86_64-apple-darwin10 -S -disable-free -main-file-name t.m
--relocation-model pic -pic-level=1 --disable-fp-elim --unwind-tables=1
--mcpu=core2 --fmath-errno=0 -mmacosx-version-min=10.6.0
-fdiagnostics-show-option -o
/var/folders/MP/MP5slYG8HRCD2v6HHtqYEE+++TI/-Tmp-/cc-PqdYj2.s -x objective-c
t.m 
1.      t.m:15:1: current parser token '@'
2.      t.m:12:1: LLVM IR generation of declaration 'I3::initialize'
3.      t.m:12:20: LLVM IR generation of compound statement ('{}')
clang: error: compiler command failed due to signal 6 (use -v to see
invocation)
--

Please enable it in the PR4894 test case when fixed.


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