[LLVMbugs] [Bug 19523] New: leak in clang::sema::DelayedDiagnostic::makeAvailability tools/clang/lib/Sema/DelayedDiagnostic.cpp

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 23 03:29:14 PDT 2014


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

            Bug ID: 19523
           Summary: leak in
                    clang::sema::DelayedDiagnostic::makeAvailability
                    tools/clang/lib/Sema/DelayedDiagnostic.cpp
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: kcc at google.com
                CC: llvmbugs at cs.uiuc.edu
            Blocks: 19521
    Classification: Unclassified

reproduce under valgrind or lsan, see bug 19521:

clang -cc1  -arcmt-check -verify -triple x86_64-apple-darwin10
~/llvm/tools/clang/test/ARCMT/atautorelease-check.m

Direct leak of 300 byte(s) in 6 object(s) allocated from:
    #0 0x7bb360 in operator new[](unsigned long)
/home/kcc/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:64
    #1 0x48ef1fe in
clang::sema::DelayedDiagnostic::makeAvailability(clang::Sema::AvailabilityDiagnostic,
clang::SourceLocation, clang::NamedDecl const*, clang::ObjCInterfaceDecl
const*, clang::ObjCPropertyDecl const*, llvm::StringRef)
/home/kcc/llvm/tools/clang/lib/Sema/DelayedDiagnostic.cpp:45
    #2 0x4bb9131 in
clang::Sema::EmitAvailabilityWarning(clang::Sema::AvailabilityDiagnostic,
clang::NamedDecl*, llvm::StringRef, clang::SourceLocation,
clang::ObjCInterfaceDecl const*, clang::ObjCPropertyDecl const*)
/home/kcc/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp:4912
    #3 0x4d67307 in DiagnoseAvailabilityOfDecl
/home/kcc/llvm/tools/clang/lib/Sema/SemaExpr.cpp:121
    #4 0x4d67307 in clang::Sema::DiagnoseUseOfDecl(clang::NamedDecl*,
clang::SourceLocation, clang::ObjCInterfaceDecl const*)
/home/kcc/llvm/tools/clang/lib/Sema/SemaExpr.cpp:300
    #5 0x4f5e87c in clang::Sema::BuildClassMessage(clang::TypeSourceInfo*,
clang::QualType, clang::SourceLocation, clang::Selector,
clang::ObjCMethodDecl*, clang::SourceLocation,
llvm::ArrayRef<clang::SourceLocation>, clang::SourceLocation,
llvm::MutableArrayRef<clang::Expr*>, bool)
/home/kcc/llvm/tools/clang/lib/Sema/SemaExprObjC.cpp:2117
    #6 0x4f61654 in clang::Sema::ActOnClassMessage(clang::Scope*,
clang::OpaquePtr<clang::QualType>, clang::Selector, clang::SourceLocation,
llvm::ArrayRef<clang::SourceLocation>, clang::SourceLocation,
llvm::MutableArrayRef<clang::Expr*>)
/home/kcc/llvm/tools/clang/lib/Sema/SemaExprObjC.cpp:2202
    #7 0x4553914 in
clang::Parser::ParseObjCMessageExpressionBody(clang::SourceLocation,
clang::SourceLocation, clang::OpaquePtr<clang::QualType>, clang::Expr*)
/home/kcc/llvm/tools/clang/lib/Parse/ParseObjc.cpp:2602
    #8 0x45514d6 in clang::Parser::ParseObjCMessageExpression()
/home/kcc/llvm/tools/clang/lib/Parse/ParseObjc.cpp:2344
    #9 0x44be0e9 in clang::Parser::ParseCastExpression(bool, bool, bool&,
clang::Parser::TypeCastState)
/home/kcc/llvm/tools/clang/lib/Parse/ParseExpr.cpp:1162
    #10 0x44ade32 in ParseCastExpression
/home/kcc/llvm/tools/clang/lib/Parse/ParseExpr.cpp:414
    #11 0x44ade32 in
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState)
/home/kcc/llvm/tools/clang/lib/Parse/ParseExpr.cpp:167
    #12 0x44adbed in
clang::Parser::ParseExpression(clang::Parser::TypeCastState)
/home/kcc/llvm/tools/clang/lib/Parse/ParseExpr.cpp:121
    #13 0x45510fb in clang::Parser::ParseObjCMessageExpression()
/home/kcc/llvm/tools/clang/lib/Parse/ParseObjc.cpp:2395
    #14 0x44be0e9 in clang::Parser::ParseCastExpression(bool, bool, bool&,
clang::Parser::TypeCastState)
/home/kcc/llvm/tools/clang/lib/Parse/ParseExpr.cpp:1162
    #15 0x44ade32 in ParseCastExpression
/home/kcc/llvm/tools/clang/lib/Parse/ParseExpr.cpp:414
    #16 0x44ade32 in
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState)
/home/kcc/llvm/tools/clang/lib/Parse/ParseExpr.cpp:167
    #17 0x44316fc in ParseInitializer
/home/kcc/llvm/tools/clang/include/clang/Parse/Parser.h:1520
    #18 0x44316fc in
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&)
/home/kcc/llvm/tools/clang/lib/Parse/ParseDecl.cpp:1830
    #19 0x442a635 in clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
unsigned int, bool, clang::SourceLocation*, clang::Parser::ForRangeInit*)
/home/kcc/llvm/tools/clang/lib/Parse/ParseDecl.cpp:1623
    #20 0x441da55 in
clang::Parser::ParseSimpleDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&,
unsigned int, clang::SourceLocation&,
clang::Parser::ParsedAttributesWithRange&, bool, clang::Parser::ForRangeInit*)
/home/kcc/llvm/tools/clang/lib/Parse/ParseDecl.cpp:1379
    #21 0x441d076 in
clang::Parser::ParseDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, unsigned
int, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&)
/home/kcc/llvm/tools/clang/lib/Parse/ParseDecl.cpp:1308
    #22 0x457b6e0 in
clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&)
/home/kcc/llvm/tools/clang/lib/Parse/ParseStmt.cpp:221
    #23 0x45790d6 in
clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*,
32u>&, bool, clang::SourceLocation*)
/home/kcc/llvm/tools/clang/lib/Parse/ParseStmt.cpp:117
    #24 0x45948cd in clang::Parser::ParseCompoundStatementBody(bool)
/home/kcc/llvm/tools/clang/lib/Parse/ParseStmt.cpp:916
    #25 0x45a1abf in clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&)
/home/kcc/llvm/tools/clang/lib/Parse/ParseStmt.cpp:2478
    #26 0x43e9f7f in
clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*)
/home/kcc/llvm/tools/clang/lib/Parse/Parser.cpp:1097
    #27 0x442a0a8 in clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
unsigned int, bool, clang::SourceLocation*, clang::Parser::ForRangeInit*)
/home/kcc/llvm/tools/clang/lib/Parse/ParseDecl.cpp:1571
    #28 0x43e7863 in
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
/home/kcc/llvm/tools/clang/lib/Parse/Parser.cpp:887
    #29 0x43e66b5 in
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
/home/kcc/llvm/tools/clang/lib/Parse/Parser.cpp:903
    #30 0x43e2ef9 in
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) /home/kcc/llvm/tools/clang/lib/Parse/Parser.cpp:761
    #31 0x43e0938 in
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
/home/kcc/llvm/tools/clang/lib/Parse/Parser.cpp:558
    #32 0x43d3406 in clang::ParseAST(clang::Sema&, bool, bool)
/home/kcc/llvm/tools/clang/lib/Parse/ParseAST.cpp:145
    #33 0x290b44a in clang::FrontendAction::Execute()
/home/kcc/llvm/tools/clang/lib/Frontend/FrontendAction.cpp:388

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140423/6713e6b6/attachment.html>


More information about the llvm-bugs mailing list