[LLVMbugs] [Bug 4902] New: clang tries to free a global variable

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Sep 5 09:12:03 PDT 2009


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

           Summary: clang tries to free a global variable
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: baldrick at free.fr
                CC: llvmbugs at cs.uiuc.edu


Valgrind detected the following problem in several clang/test/CodeGenObjC
tests, for example objc2-assign-global.m.  It is trying to free something
that wasn't malloced, the data symbol _ZNSs4_Rep20_S_empty_rep_storageE.

==750== Invalid free() / delete / delete[]
==750==    at 0x4C24AEA: operator delete(void*) (vg_replace_malloc.c:346)
==750==    by 0x41C52F: __gnu_cxx::new_allocator<char>::deallocate(char*,
unsigned long) (new_allocator.h:95)
==750==    by 0x418484: std::string::_Rep::_M_destroy(std::allocator<char>
const&) (basic_string.tcc:427)
==750==    by 0x414011: std::string::_Rep::_M_dispose(std::allocator<char>
const&) (basic_string.h:231)
==750==    by 0x40CE37: std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::~basic_string() (basic_string.h:498)
==750==    by 0x5EF5EA: (anonymous namespace)::CGObjCMac::FinishModule()
(CGObjCMac.cpp:3512)
==750==    by 0x5E9EBD: (anonymous namespace)::CGObjCMac::ModuleInitFunction()
(CGObjCMac.cpp:2340)
==750==    by 0x54E7F8: clang::CodeGen::CodeGenModule::Release()
(CodeGenModule.cpp:70)
==750==    by 0x54D66E: (anonymous
namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&)
(ModuleBuilder.cpp:85)
==750==    by 0x4361FB: (anonymous
namespace)::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(Backend.cpp:142)
==750==    by 0x732285: clang::ParseAST(clang::Preprocessor&,
clang::ASTConsumer*, clang::ASTContext&, bool, bool) (ParseAST.cpp:79)
==750==    by 0x4052CB: ProcessInputFile(clang::Preprocessor&,
clang::PreprocessorFactory&, std::string const&, ProgActions,
llvm::StringMap<bool, llvm::MallocAllocator> const&, llvm::LLVMContext&)
(clang-cc.cpp:2084)
==750==  Address 0x532b160 is 0 bytes inside data symbol
"_ZNSs4_Rep20_S_empty_rep_storageE"


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