[LLVMbugs] [Bug 13332] New: infinite loop

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jul 11 12:31:01 PDT 2012


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

             Bug #: 13332
           Summary: infinite loop
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: rafael.espindola at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 8876
  --> http://llvm.org/bugs/attachment.cgi?id=8876
testcase

With the attached testcase clang loop forever when running

clang -cc1 -std=gnu++0x -ferror-limit 1 clang-bug.ii -w

The backtrace is

#0  0x00000000019d1bf9 in llvm::PointerIntPair<llvm::PointerUnion<clang::Type
const*, clang::ExtQuals const*>, 3u, unsigned int,
llvm::PointerLikeTypeTraits<llvm::PointerUnion<clang::Type const*,
clang::ExtQuals const*> > >::getPointer (this=0x4490148)
    at /home/espindola/llvm/llvm/include/llvm/ADT/PointerIntPair.h:69
#1  0x00000000019c8282 in clang::QualType::isNull (this=0x4490148) at
/home/espindola/llvm/llvm/tools/clang/include/clang/AST/Type.h:559
#2  0x00000000019c8154 in clang::QualType::getCommonPtr (this=0x4490148) at
/home/espindola/llvm/llvm/tools/clang/include/clang/AST/Type.h:505
#3  0x00000000019c9026 in clang::QualType::getTypePtr (this=0x4490148) at
/home/espindola/llvm/llvm/tools/clang/include/clang/AST/Type.h:4547
#4  0x00000000019c8426 in llvm::simplify_type<clang::QualType
const>::getSimplifiedValue (Val=...) at
/home/espindola/llvm/llvm/tools/clang/include/clang/AST/Type.h:966
#5  0x00000000019d7591 in llvm::isa_impl_wrap<clang::RecordType,
clang::QualType, clang::Type const*>::doit (Val=...) at
/home/espindola/llvm/llvm/include/llvm/Support/Casting.h:91
#6  0x00000000019d2044 in llvm::isa<clang::RecordType, clang::QualType>
(Val=...) at /home/espindola/llvm/llvm/include/llvm/Support/Casting.h:110
#7  0x00000000019d1ea7 in llvm::cast<clang::RecordType, clang::QualType>
(Val=...) at /home/espindola/llvm/llvm/include/llvm/Support/Casting.h:194
#8  0x00000000019f1918 in llvm::dyn_cast<clang::RecordType, clang::QualType>
(Val=...) at /home/espindola/llvm/llvm/include/llvm/Support/Casting.h:220
#9  0x00000000019f1324 in clang::Type::getAs<clang::RecordType>
(this=0x4490140) at
/home/espindola/llvm/llvm/tools/clang/include/clang/AST/TypeNodes.def:116
#10 0x00000000028507fa in clang::CXXRecordDecl::forallBases (this=0x44900b0,
BaseMatches=0x28506f5 <BaseIsNot(clang::CXXRecordDecl const*, void*)>,
OpaqueData=0x4298ec0, AllowShortCircuit=true) at
/home/espindola/llvm/llvm/tools/clang/lib/AST/CXXInheritance.cpp:133
#11 0x0000000002850768 in clang::CXXRecordDecl::isProvablyNotDerivedFrom
(this=0x44900b0, Base=0x437ec90) at
/home/espindola/llvm/llvm/tools/clang/lib/AST/CXXInheritance.cpp:120
#12 0x00000000022531f3 in ClassifyImplicitMemberAccess (SemaRef=...,
CurScope=0x40bef40, R=...) at
/home/espindola/llvm/llvm/tools/clang/lib/Sema/SemaExprMember.cpp:172
#13 0x00000000022536a4 in clang::Sema::BuildPossibleImplicitMemberExpr
(this=0x40e3990, SS=..., TemplateKWLoc=..., R=..., TemplateArgs=0x0) at
/home/espindola/llvm/llvm/tools/clang/lib/Sema/SemaExprMember.cpp:229
#14 0x00000000021adf6e in clang::Sema::ActOnIdExpression (this=0x40e3990,
S=0x40bef40, SS=..., TemplateKWLoc=..., Id=..., HasTrailingLParen=true,
IsAddressOfOperand=false, CCC=0x7fffffff7560) at
/home/espindola/llvm/llvm/tools/clang/lib/Sema/SemaExpr.cpp:1844
#15 0x0000000001cb93a6 in clang::Parser::ParseCastExpression (this=0x40e6220,
isUnaryExpression=false, isAddressOfOperand=false, NotCastExpr=@0x7fffffff787f:
false, isTypeCast=clang::Parser::NotTypeCast) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseExpr.cpp:846
#16 0x0000000001cb867c in clang::Parser::ParseCastExpression (this=0x40e6220,
isUnaryExpression=false, isAddressOfOperand=false,
isTypeCast=clang::Parser::NotTypeCast) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseExpr.cpp:458
#17 0x0000000001cb7847 in clang::Parser::ParseAssignmentExpression
(this=0x40e6220, isTypeCast=clang::Parser::NotTypeCast) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseExpr.cpp:229
#18 0x0000000001cbf0d6 in clang::Parser::ParseExpressionList (this=0x40e6220,
Exprs=..., CommaLocs=..., Completer=NULL, Data=0x0) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseExpr.cpp:2312
#19 0x0000000001cc4a6a in clang::Parser::ParseCXXTypeConstructExpression
(this=0x40e6220, DS=...) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp:1245
#20 0x0000000001cb9f03 in clang::Parser::ParseCastExpression (this=0x40e6220,
isUnaryExpression=false, isAddressOfOperand=false, NotCastExpr=@0x7fffffff8bff:
false, isTypeCast=clang::Parser::NotTypeCast) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseExpr.cpp:1038
#21 0x0000000001cb867c in clang::Parser::ParseCastExpression (this=0x40e6220,
isUnaryExpression=false, isAddressOfOperand=false,
isTypeCast=clang::Parser::NotTypeCast) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseExpr.cpp:458
#22 0x0000000001cb8b80 in clang::Parser::ParseCastExpression (this=0x40e6220,
isUnaryExpression=false, isAddressOfOperand=false, NotCastExpr=@0x7fffffff972f:
false, isTypeCast=clang::Parser::NotTypeCast) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseExpr.cpp:753
#23 0x0000000001cb867c in clang::Parser::ParseCastExpression (this=0x40e6220,
isUnaryExpression=false, isAddressOfOperand=false,
isTypeCast=clang::Parser::NotTypeCast) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseExpr.cpp:458
#24 0x0000000001cb7847 in clang::Parser::ParseAssignmentExpression
(this=0x40e6220, isTypeCast=clang::Parser::NotTypeCast) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseExpr.cpp:229
#25 0x0000000001cb764a in clang::Parser::ParseExpression (this=0x40e6220,
isTypeCast=clang::Parser::NotTypeCast) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseExpr.cpp:181
#26 0x0000000001ce260c in clang::Parser::ParseReturnStatement (this=0x40e6220)
at /home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseStmt.cpp:1632
#27 0x0000000001cdd858 in
clang::Parser::ParseStatementOrDeclarationAfterAttributes (this=0x40e6220,
Stmts=..., OnlyStatement=false, TrailingElseLoc=0x0, Attrs=...) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseStmt.cpp:283
#28 0x0000000001cdccc0 in clang::Parser::ParseStatementOrDeclaration
(this=0x40e6220, Stmts=..., OnlyStatement=false, TrailingElseLoc=0x0) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseStmt.cpp:89
#29 0x0000000001cdf69d in clang::Parser::ParseCompoundStatementBody
(this=0x40e6220, isStmtExpr=false) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseStmt.cpp:794
#30 0x0000000001ce3f30 in clang::Parser::ParseFunctionStatementBody
(this=0x40e6220, Decl=0x4490640, BodyScope=...) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseStmt.cpp:2046
#31 0x0000000001cef49f in clang::Parser::ParseLexedMethodDef (this=0x40e6220,
LM=...) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp:428
#32 0x0000000001cee75d in clang::Parser::LexedMethod::ParseLexedMethodDefs
(this=0x44997b0) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp:252
#33 0x0000000001ceefd6 in clang::Parser::ParseLexedMethodDefs (this=0x40e6220,
Class=...) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp:374
#34 0x0000000001cb1902 in clang::Parser::ParseCXXMemberSpecification
(this=0x40e6220, RecordLoc=..., TagType=18, TagDecl=0x437ed20) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp:2425
#35 0x0000000001cae341 in clang::Parser::ParseClassSpecifier (this=0x40e6220,
TagTokKind=clang::tok::kw_class, StartLoc=..., DS=..., TemplateInfo=...,
AS=clang::AS_none, EnteringContext=true, DSC=clang::Parser::DSC_top_level)
    at /home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp:1437
#36 0x0000000001c9c026 in clang::Parser::ParseDeclarationSpecifiers
(this=0x40e6220, DS=..., TemplateInfo=..., AS=clang::AS_none,
DSContext=clang::Parser::DSC_top_level, LateAttrs=0x0) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseDecl.cpp:2653
#37 0x0000000001ce5b5d in clang::Parser::ParseSingleDeclarationAfterTemplate
(this=0x40e6220, Context=0, TemplateInfo=..., DiagsFromTParams=...,
DeclEnd=..., AS=clang::AS_none, AccessAttrs=0x0) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseTemplate.cpp:228
#38 0x0000000001ce5930 in
clang::Parser::ParseTemplateDeclarationOrSpecialization (this=0x40e6220,
Context=0, DeclEnd=..., AS=clang::AS_none, AccessAttrs=0x0) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseTemplate.cpp:169
#39 0x0000000001ce5481 in clang::Parser::ParseDeclarationStartingWithTemplate
(this=0x40e6220, Context=0, DeclEnd=..., AS=clang::AS_none, AccessAttrs=0x0) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseTemplate.cpp:39
#40 0x0000000001c96eff in clang::Parser::ParseDeclaration (this=0x40e6220,
Stmts=..., Context=0, DeclEnd=..., attrs=...) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseDecl.cpp:1092
#41 0x0000000001c886ef in clang::Parser::ParseExternalDeclaration
(this=0x40e6220, attrs=..., DS=0x0) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/Parser.cpp:686
#42 0x0000000001c88064 in clang::Parser::ParseTopLevelDecl (this=0x40e6220,
Result=...) at /home/espindola/llvm/llvm/tools/clang/lib/Parse/Parser.cpp:566
#43 0x0000000001c84b61 in clang::ParseAST (S=..., PrintStats=false,
SkipFunctionBodies=false) at
/home/espindola/llvm/llvm/tools/clang/lib/Parse/ParseAST.cpp:102
#44 0x0000000001bea190 in clang::ASTFrontendAction::ExecuteAction
(this=0x40a11f0) at
/home/espindola/llvm/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:418
#45 0x0000000001be9dc4 in clang::FrontendAction::Execute (this=0x40a11f0) at
/home/espindola/llvm/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:335
#46 0x0000000001bc553d in clang::CompilerInstance::ExecuteAction
(this=0x409e500, Act=...) at
/home/espindola/llvm/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:672
#47 0x000000000196b960 in clang::ExecuteCompilerInvocation (Clang=0x409e500) at
/home/espindola/llvm/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:188
#48 0x0000000000b90e70 in cc1_main (ArgBegin=0x7fffffffd160,
ArgEnd=0x7fffffffd188, Argv0=0x409e228
"/home/espindola/llvm/build-dbg/bin/clang", MainAddr=0xb897ac) at
/home/espindola/llvm/llvm/tools/clang/tools/driver/cc1_main.cpp:165
#49 0x0000000000b8afeb in main (argc_=7, argv_=0x7fffffffdd68) at
/home/espindola/llvm/llvm/tools/clang/tools/driver/driver.cpp:358


The function that never finishes is clang::CXXRecordDecl::forallBases

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