[LLVMbugs] [Bug 19520] New: memory leak in clang/lib/Frontend/VerifyDiagnosticConsumer.cpp

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 23 02:45:44 PDT 2014


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

            Bug ID: 19520
           Summary: memory leak in
                    clang/lib/Frontend/VerifyDiagnosticConsumer.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
    Classification: Unclassified

(I am trying to enable LeakSanitizer by default and make clang bootstrap pass
with it)

Reproduce: 
1. either build asan-ified clang (-DLLVM_USE_SANITIZER=Address) or run regular
clang with valgrind
2. clang -cc1  -arcmt-check -verify -triple x86_64-apple-darwin10 -fsyntax-only
-fblocks $LLVM/tools/clang/test/ARCMT/cxx-checking.mm

Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x7bb200 in operator new(unsigned long)
llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:62
    #1 0x298508f in clang::VerifyDiagnosticConsumer::Directive::create(bool,
clang::SourceLocation, clang::SourceLocation, llvm::StringRef, unsigned int,
unsigned int) llvm/tools/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp:858
    #2 0x2981d21 in ParseDirective(llvm::StringRef,
clang::VerifyDiagnosticConsumer::ExpectedData*, clang::SourceManager&,
clang::Preprocessor*, clang::SourceLocation,
clang::VerifyDiagnosticConsumer::DirectiveStatus&)
llvm/tools/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp:494
    #3 0x297fb98 in
clang::VerifyDiagnosticConsumer::HandleComment(clang::Preprocessor&,
clang::SourceRange)
llvm/tools/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp:531
    #4 0x298385c in non-virtual thunk to
clang::VerifyDiagnosticConsumer::HandleComment(clang::Preprocessor&,
clang::SourceRange)
llvm/tools/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp:563
    #5 0x612bddd in clang::Preprocessor::HandleComment(clang::Token&,
clang::SourceRange) llvm/tools/clang/lib/Lex/Preprocessor.cpp:815
    #6 0x6023806 in clang::Lexer::SkipLineComment(clang::Token&, char const*,
bool&) llvm/tools/clang/lib/Lex/Lexer.cpp:2131
    #7 0x602d1da in clang::Lexer::LexTokenInternal(clang::Token&, bool)
llvm/tools/clang/lib/Lex/Lexer.cpp:3334
    #8 0x602744c in clang::Lexer::Lex(clang::Token&)
llvm/tools/clang/lib/Lex/Lexer.cpp:2905
    #9 0x6128f71 in clang::Preprocessor::Lex(clang::Token&)
llvm/tools/clang/lib/Lex/Preprocessor.cpp:670
    #10 0x43d7da2 in ConsumeToken
llvm/tools/clang/include/clang/Parse/Parser.h:297
    #11 0x43d7da2 in clang::Parser::ConsumeAnyToken(bool)
llvm/tools/clang/include/clang/Parse/Parser.h:364
    #12 0x43d71df in clang::Parser::ExpectAndConsume(clang::tok::TokenKind,
unsigned int, char const*) llvm/tools/clang/lib/Parse/Parser.cpp:114
    #13 0x4496c9e in
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*) llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp:2409
    #14 0x4489479 in
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&, unsigned int,
clang::Decl*) llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp:2693
    #15 0x4483e5d in clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&)
llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp:1623
    #16 0x4420aa2 in
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*)
llvm/tools/clang/lib/Parse/ParseDecl.cpp:3068
    #17 0x43e702f in
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
llvm/tools/clang/lib/Parse/Parser.cpp:830
    #18 0x43e66b5 in
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
llvm/tools/clang/lib/Parse/Parser.cpp:903
    #19 0x43e2ef9 in
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) llvm/tools/clang/lib/Parse/Parser.cpp:761
    #20 0x43e0938 in
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
llvm/tools/clang/lib/Parse/Parser.cpp:558
    #21 0x43d3406 in clang::ParseAST(clang::Sema&, bool, bool)
llvm/tools/clang/lib/Parse/ParseAST.cpp:145
    #22 0x290b44a in clang::FrontendAction::Execute()
llvm/tools/clang/lib/Frontend/FrontendAction.cpp:388
    #23 0x2a0ffbf in
clang::ASTUnit::LoadFromCompilerInvocationAction(clang::CompilerInvocation*,
llvm::IntrusiveRefCntPtr<clang::DiagnosticsEngine>, clang::ASTFrontendAction*,
clang::ASTUnit*, bool, llvm::StringRef, bool, bool, bool, bool, bool, bool,
std::unique_ptr<clang::ASTUnit, std::default_delete<clang::ASTUniĀ»
    #24 0x3f2f3d1 in
clang::arcmt::checkForManualIssues(clang::CompilerInvocation&,
clang::FrontendInputFile const&, clang::DiagnosticConsumer*, bool,
llvm::StringRef) llvm/tools/clang/lib/ARCMigrate/ARCMT.cpp:267
    #25 0x3dea37a in
clang::arcmt::CheckAction::BeginInvocation(clang::CompilerInstance&)
llvm/tools/clang/lib/ARCMigrate/ARCMTActions.cpp:18
    #26 0x29077f5 in
clang::FrontendAction::BeginSourceFile(clang::CompilerInstance&,
clang::FrontendInputFile const&)
llvm/tools/clang/lib/Frontend/FrontendAction.cpp:171
    #27 0x288fe90 in
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
llvm/tools/clang/lib/Frontend/CompilerInstance.cpp:726
    #28 0x2a5fe6f in clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:239
    #29 0x7e2648 in cc1_main(char const**, char const**, char const*, void*)
llvm/tools/clang/tools/driver/cc1_main.cpp:112
    #30 0x7ddc30 in main llvm/tools/clang/tools/driver/driver.cpp:318

-- 
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/313b2952/attachment.html>


More information about the llvm-bugs mailing list