[llvm-commits] Invalid memory access due to debug info which building gcc

Devang Patel dpatel at apple.com
Fri Jan 16 10:00:17 PST 2009


On Jan 16, 2009, at 6:33 AM, Duncan Sands wrote:

> Hi Devang, if I configure llvm-gcc like this:
>
>  CFLAGS="-O0 -g" ../gcc-4.2.llvm/configure --prefix=... --enable- 
> languages=c,c++,fortran --enable-checking --enable-llvm=... -- 
> disable-bootstrap --disable-multilib
>
> then build, the build fails when compiling gcc/unwind-dw2-fde-glibc.c.

Duncan,

I am investigating similar case. Would it be possible to get a small  
test case (preprocessed source)?
Thanks,
-
Devang
>
>
> Valgrind reports
>
> ==3056== Invalid read of size 8
> ==3056==    at 0xF1C820:  
> llvm::DwarfDebug::AddType(llvm::CompileUnit*, llvm::DIE*,  
> llvm::DIType) (DwarfWriter.cpp:1702)
> ==3056==    by 0xF1CF5F:  
> llvm::DwarfDebug::ConstructTypeDIE(llvm::CompileUnit*, llvm::DIE&,  
> llvm::DIDerivedType) (DwarfWriter.cpp:1735)
> ==3056==    by 0xF1C768:  
> llvm::DwarfDebug::AddType(llvm::CompileUnit*, llvm::DIE*,  
> llvm::DIType) (DwarfWriter.cpp:1694)
> ==3056==    by 0xF23DF7:  
> llvm::DwarfDebug::ConstructGlobalVariableDIEs() (DwarfWriter.cpp:2823)
> ==3056==    by 0xF24369:  
> llvm::DwarfDebug::SetDebugInfo(llvm::MachineModuleInfo*)  
> (DwarfWriter.cpp:2929)
> ==3056==    by 0xF06D31:  
> llvm::DwarfWriter::BeginModule(llvm::Module*,  
> llvm::MachineModuleInfo*, llvm::raw_ostream&, llvm::AsmPrinter*,  
> llvm::TargetAsmInfo const*) (DwarfWriter.cpp:4244)
> ==3056==    by 0xBD5B45:  
> llvm::X86ATTAsmPrinter::doInitialization(llvm::Module&)  
> (X86ATTAsmPrinter.cpp:739)
> ==3056==    by 0x11B70C3:  
> llvm::FPPassManager::doInitialization(llvm::Module&)  
> (PassManager.cpp:1356)
> ==3056==    by 0x11B72DA:  
> llvm::FunctionPassManagerImpl::doInitialization(llvm::Module&)  
> (PassManager.cpp:1250)
> ==3056==    by 0x11AEA54:  
> llvm::FunctionPassManager::doInitialization() (PassManager.cpp:1233)
> ==3056==    by 0xA04A01: llvm_asm_file_end (llvm-backend.cpp:688)
> ==3056==    by 0x971761: compile_file (toplev.c:1191)
> ==3056==  Address 0x6fe8480 is 952 bytes inside a block of size  
> 1,024 free'd
> ==3056==    at 0x4C2514D: operator delete(void*)  
> (vg_replace_malloc.c:342)
> ==3056==    by 0xF113EB: llvm::DenseMap<llvm::GlobalVariable*,  
> llvm::DIEntry*, llvm::DenseMapInfo<llvm::GlobalVariable*>,  
> llvm::DenseMapInfo<llvm::DIEntry*> >::grow(unsigned int) (DenseMap.h: 
> 424)
> ==3056==    by 0xF1145D: llvm::DenseMap<llvm::GlobalVariable*,  
> llvm::DIEntry*, llvm::DenseMapInfo<llvm::GlobalVariable*>,  
> llvm::DenseMapInfo<llvm::DIEntry*>  
> >::InsertIntoBucket(llvm::GlobalVariable* const&, llvm::DIEntry*  
> const&, std::pair<llvm::GlobalVariable*, llvm::DIEntry*>*)  
> (DenseMap.h:306)
> ==3056==    by 0xF11539: llvm::DenseMap<llvm::GlobalVariable*,  
> llvm::DIEntry*, llvm::DenseMapInfo<llvm::GlobalVariable*>,  
> llvm::DenseMapInfo<llvm::DIEntry*>  
> >::FindAndConstruct(llvm::GlobalVariable* const&) (DenseMap.h:249)
> ==3056==    by 0xF11560: llvm::DenseMap<llvm::GlobalVariable*,  
> llvm::DIEntry*, llvm::DenseMapInfo<llvm::GlobalVariable*>,  
> llvm::DenseMapInfo<llvm::DIEntry*> >::operator[] 
> (llvm::GlobalVariable* const&) (DenseMap.h:253)
> ==3056==    by 0xF11588:  
> llvm::CompileUnit::getDIEntrySlotFor(llvm::GlobalVariable*)  
> (DwarfWriter.cpp:839)
> ==3056==    by 0xF1C634:  
> llvm::DwarfDebug::AddType(llvm::CompileUnit*, llvm::DIE*,  
> llvm::DIType) (DwarfWriter.cpp:1679)
> ==3056==    by 0xF1D653:  
> llvm::DwarfDebug::ConstructFieldTypeDIE(llvm::CompileUnit*,  
> llvm::DIE&, llvm::DIDerivedType) (DwarfWriter.cpp:1950)
> ==3056==    by 0xF1DB29:  
> llvm::DwarfDebug::ConstructTypeDIE(llvm::CompileUnit*, llvm::DIE&,  
> llvm::DICompositeType) (DwarfWriter.cpp:1810)
> ==3056==    by 0xF1C7D7:  
> llvm::DwarfDebug::AddType(llvm::CompileUnit*, llvm::DIE*,  
> llvm::DIType) (DwarfWriter.cpp:1697)
> ==3056==    by 0xF1CF5F:  
> llvm::DwarfDebug::ConstructTypeDIE(llvm::CompileUnit*, llvm::DIE&,  
> llvm::DIDerivedType) (DwarfWriter.cpp:1735)
> ==3056==    by 0xF1C768:  
> llvm::DwarfDebug::AddType(llvm::CompileUnit*, llvm::DIE*,  
> llvm::DIType) (DwarfWriter.cpp:1694)
>
> and so on.
>
> Ciao,
>
> Duncan.

-
Devang






More information about the llvm-commits mailing list