[LLVMbugs] [Bug 4894] New: Crash while emitting debug information for complex Objective-C classes

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Sep 4 19:31:48 PDT 2009


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

           Summary: Crash while emitting debug information for complex
                    Objective-C classes
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: csdavec at swan.ac.uk
                CC: llvmbugs at cs.uiuc.edu


At some point during compilation of the attached preprocessed source file, the
stack-allocated FwdDecl instance's DbgNode pointer becomes dangling, causing a
crash when it is dereferenced, with the following stack trace:

#0  0x0818f3d5 in llvm::Type::getForwardedType (this=0x5a5a5a5a) at Type.h:302
#1  0x0818f66f in llvm::PATypeHolder::get (this=0x29cdeb48) at Type.h:435
#2  0x0818f6bd in llvm::PATypeHolder::operator llvm::Type* (this=0x29cdeb48) at
AbstractTypeUser.h:151
#3  0x0818f6f0 in llvm::Value::getType (this=0x29cdeb40) at Value.h:103
#4  0x0915df8d in llvm::Value::replaceAllUsesWith (this=0x29cdeb40,
New=0x29ceabc0) at Value.cpp:326
#5  0x0903c81e in llvm::DIDerivedType::replaceAllUsesWith (this=0xbfbfbb80,
D=@0xbfbfbb78) at DebugInfo.cpp:270
#6  0x081beee0 in clang::CodeGen::CGDebugInfo::CreateType (this=0x29730780,
Ty=0x29b9c1d0, Unit=@0xbfbfbd04) at CGDebugInfo.cpp:642
#7  0x081bcf61 in clang::CodeGen::CGDebugInfo::getOrCreateType
(this=0x29730780, Ty={Value = {Value = 700039632}, static MaxAddressSpace =
16777215}, Unit=@0xbfbfbe20) at CGDebugInfo.cpp:783
#8  0x081c16a6 in clang::CodeGen::CGDebugInfo::CreateType (this=0x29730780,
Ty=0x29b9c228, Unit=@0xbfbfbeb4) at CGDebugInfo.cpp:205
#9  0x081bced4 in clang::CodeGen::CGDebugInfo::getOrCreateType
(this=0x29730780, Ty={Value = {Value = 700039720}, static MaxAddressSpace =
16777215}, Unit=@0xbfbfc108) at CGDebugInfo.cpp:781
#10 0x081be9c3 in clang::CodeGen::CGDebugInfo::CreateType (this=0x29730780,
Ty=0x29a953e0, Unit=@0xbfbfc224) at CGDebugInfo.cpp:580
#11 0x081bcf61 in clang::CodeGen::CGDebugInfo::getOrCreateType
(this=0x29730780, Ty={Value = {Value = 698962912}, static MaxAddressSpace =
16777215}, Unit=@0xbfbfc340) at CGDebugInfo.cpp:783
#12 0x081c16a6 in clang::CodeGen::CGDebugInfo::CreateType (this=0x29730780,
Ty=0x29a95438, Unit=@0xbfbfc3d4) at CGDebugInfo.cpp:205
#13 0x081bced4 in clang::CodeGen::CGDebugInfo::getOrCreateType
(this=0x29730780, Ty={Value = {Value = 698963000}, static MaxAddressSpace =
16777215}, Unit=@0xbfbfc628) at CGDebugInfo.cpp:781
#14 0x081be9c3 in clang::CodeGen::CGDebugInfo::CreateType (this=0x29730780,
Ty=0x29a95008, Unit=@0xbfbfc744) at CGDebugInfo.cpp:580
#15 0x081bcf61 in clang::CodeGen::CGDebugInfo::getOrCreateType
(this=0x29730780, Ty={Value = {Value = 698961928}, static MaxAddressSpace =
16777215}, Unit=@0xbfbfc960) at CGDebugInfo.cpp:783
#16 0x081be79c in clang::CodeGen::CGDebugInfo::CreateType (this=0x29730780,
Ty=0x29a84328, Unit=@0xbfbfcaa4) at CGDebugInfo.cpp:566
#17 0x081bcf61 in clang::CodeGen::CGDebugInfo::getOrCreateType
(this=0x29730780, Ty={Value = {Value = 698893096}, static MaxAddressSpace =
16777215}, Unit=@0xbfbfcbc0) at CGDebugInfo.cpp:783
#18 0x081c16a6 in clang::CodeGen::CGDebugInfo::CreateType (this=0x29730780,
Ty=0x29a84380, Unit=@0xbfbfcc54) at CGDebugInfo.cpp:205
#19 0x081bced4 in clang::CodeGen::CGDebugInfo::getOrCreateType
(this=0x29730780, Ty={Value = {Value = 698893184}, static MaxAddressSpace =
16777215}, Unit=@0xbfbfcea8) at CGDebugInfo.cpp:781
#20 0x081be9c3 in clang::CodeGen::CGDebugInfo::CreateType (this=0x29730780,
Ty=0x29cd04a8, Unit=@0xbfbfcfc4) at CGDebugInfo.cpp:580
#21 0x081bcf61 in clang::CodeGen::CGDebugInfo::getOrCreateType
(this=0x29730780, Ty={Value = {Value = 701301928}, static MaxAddressSpace =
16777215}, Unit=@0xbfbfd0e0) at CGDebugInfo.cpp:783
#22 0x081c16a6 in clang::CodeGen::CGDebugInfo::CreateType (this=0x29730780,
Ty=0x29cd04e8, Unit=@0xbfbfd174) at CGDebugInfo.cpp:205
#23 0x081bced4 in clang::CodeGen::CGDebugInfo::getOrCreateType
(this=0x29730780, Ty={Value = {Value = 701301992}, static MaxAddressSpace =
16777215}, Unit=@0xbfbfd2a4) at CGDebugInfo.cpp:781
#24 0x081bdc16 in clang::CodeGen::CGDebugInfo::EmitDeclare (this=0x29730780,
Decl=0x29cd0540, Tag=257, Storage=0x29cd818c, Builder=@0xbfbfd694) at
CGDebugInfo.cpp:904
#25 0x081bddea in clang::CodeGen::CGDebugInfo::EmitDeclareOfArgVariable
(this=0x29730780, Decl=0x29cd0540, AI=0x29cd818c, Builder=@0xbfbfd694) at
CGDebugInfo.cpp:934
#26 0x081c766d in clang::CodeGen::CodeGenFunction::EmitParmDecl
(this=0xbfbfd610, D=@0x29cd0540, Arg=0x29cd91e0) at CGDecl.cpp:521
#27 0x081b7a4c in clang::CodeGen::CodeGenFunction::EmitFunctionProlog
(this=0xbfbfd610, FI=@0x29c148f0, Fn=0x29cda1a0, Args=@0xbfbfd4e0) at
CGCall.cpp:580
#28 0x08237823 in clang::CodeGen::CodeGenFunction::StartFunction
(this=0xbfbfd610, D=0x29cd0460, RetTy={Value = {Value = 695829456}, static
MaxAddressSpace = 16777215}, Fn=0x29cda1a0, 
    Args=@0xbfbfd4e0, StartLoc={ID = 823520}) at CodeGenFunction.cpp:189
#29 0x081f7cf4 in clang::CodeGen::CodeGenFunction::StartObjCMethod
(this=0xbfbfd610, OMD=0x29cd0460, CD=0x29ccc150) at CGObjC.cpp:122
#30 0x081f8ef5 in clang::CodeGen::CodeGenFunction::GenerateObjCMethod
(this=0xbfbfd610, OMD=0x29cd0460) at CGObjC.cpp:131
#31 0x08181516 in clang::CodeGen::CodeGenModule::EmitTopLevelDecl
(this=0x2970dc00, D=0x29cd0460) at CodeGenModule.cpp:1699
#32 0x0817b240 in HandleTopLevelDecl (this=0x297066c0, DG={D = 0x29cd0460}) at
ModuleBuilder.cpp:67
#33 0x080973f0 in HandleTopLevelDecl (this=0x29786100, D={D = 0x29cd0460}) at
Backend.cpp:130
#34 0x08336353 in clang::ParseAST (PP=@0x297581c0, Consumer=0x29786100,
Ctx=@0x2978c400, PrintStats=false, CompleteTranslationUnit=true) at
ParseAST.cpp:70
#35 0x0806fd8a in ProcessInputFile (PP=@0x297581c0, PPF=@0xbfbfe414,
InFile=@0x297070e0, PA=EmitAssembly, Features=@0xbfbfe440, Context=@0x297070ac)
at clang-cc.cpp:2084
#36 0x08071af0 in main (argc=20, argv=0xbfbfe540) at clang-cc.cpp:2355


This occurs while emitting the type information for the self implicit argument
in the first method of the class.  The class itself has a  number of instance
variables which refer to other classes, so the problem may be related different
classes at different depths in this structure referring to each other, so that
the debug node forward declaration is already replaced by something else by the
time this is reached.


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