[LLVMbugs] [Bug 2224] New: Buffer overflow in WriteConstantInt

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Apr 15 12:10:50 PDT 2008


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

           Summary: Buffer overflow in WriteConstantInt
           Product: new-bugs
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: baldrick at free.fr
                CC: llvmbugs at cs.uiuc.edu


Detected by running the testcase
test/CFrontend/2008-01-21-PackedStructField.c
under valgrind:

Invalid read of size 4
   at 0x8A926B0: WriteConstantInt(std::ostream&, llvm::Constant const*,
std::map<llvm::Type const*, std::string, std::less<llvm::Type const*>,
std::allocator<std::pair<llvm::Type const* const, std::string> > >&,
llvm::SlotMachine*) (AsmWriter.cpp:531)
   by 0x8A8F170: WriteAsOperandInternal(std::ostream&, llvm::Value const*,
std::map<llvm::Type const*, std::string, std::less<llvm::Type const*>,
std::allocator<std::pair<llvm::Type const* const, std::string> > >&,
llvm::SlotMachine*) (AsmWriter.cpp:654)
   by 0x8A92A44: WriteConstantInt(std::ostream&, llvm::Constant const*,
std::map<llvm::Type const*, std::string, std::less<llvm::Type const*>,
std::allocator<std::pair<llvm::Type const* const, std::string> > >&,
llvm::SlotMachine*) (AsmWriter.cpp:579)
   by 0x8A8F170: WriteAsOperandInternal(std::ostream&, llvm::Value const*,
std::map<llvm::Type const*, std::string, std::less<llvm::Type const*>,
std::allocator<std::pair<llvm::Type const* const, std::string> > >&,
llvm::SlotMachine*) (AsmWriter.cpp:654)
   by 0x8A8F4AA: llvm::AssemblyWriter::writeOperand(llvm::Value const*, bool)
(AsmWriter.cpp:837)
   by 0x8A91A6D: llvm::AssemblyWriter::printGlobal(llvm::GlobalVariable const*)
(AsmWriter.cpp:959)
   by 0x8A92079: llvm::AssemblyWriter::printModule(llvm::Module const*)
(AsmWriter.cpp:908)
   by 0x8A962B1: llvm::AssemblyWriter::write(llvm::Module const*)
(AsmWriter.cpp:735)
   by 0x8A93445: llvm::Module::print(std::ostream&,
llvm::AssemblyAnnotationWriter*) const (AsmWriter.cpp:1462)
   by 0x8410199: llvm::PrintModulePass::runOnModule(llvm::Module&)
(Module.h:353)
   by 0x8AEECF1: llvm::MPPassManager::runOnModule(llvm::Module&)
(PassManager.cpp:1248)
   by 0x8AEEEA9: llvm::PassManagerImpl::run(llvm::Module&)
(PassManager.cpp:1322)

 Address 0x433b26c is 4 bytes after a block of size 16 alloc'd
   at 0x4022F44: operator new[](unsigned) (vg_replace_malloc.c:268)
   by 0x8B2D0DF: getClearedMemory(unsigned) (APInt.cpp:40)
   by 0x8B3559E: llvm::APInt::APInt(unsigned, unsigned, unsigned long long
const*) (APInt.cpp:79)
   by 0x8B2527F: llvm::APFloat::convertF80LongDoubleAPFloatToAPInt() const
(APFloat.cpp:2489)
   by 0x8B25341: llvm::APFloat::convertToAPInt() const (APFloat.cpp:2614)
   by 0x8A925FB: WriteConstantInt(std::ostream&, llvm::Constant const*,
std::map<llvm::Type const*, std::string, std::less<llvm::Type const*>,
std::allocator<std::pair<llvm::Type const* const, std::string> > >&,
llvm::SlotMachine*) (AsmWriter.cpp:519)
   by 0x8A8F170: WriteAsOperandInternal(std::ostream&, llvm::Value const*,
std::map<llvm::Type const*, std::string, std::less<llvm::Type const*>,
std::allocator<std::pair<llvm::Type const* const, std::string> > >&,
llvm::SlotMachine*) (AsmWriter.cpp:654)
   by 0x8A92A44: WriteConstantInt(std::ostream&, llvm::Constant const*,
std::map<llvm::Type const*, std::string, std::less<llvm::Type const*>,
std::allocator<std::pair<llvm::Type const* const, std::string> > >&,
llvm::SlotMachine*) (AsmWriter.cpp:579)
   by 0x8A8F170: WriteAsOperandInternal(std::ostream&, llvm::Value const*,
std::map<llvm::Type const*, std::string, std::less<llvm::Type const*>,
std::allocator<std::pair<llvm::Type const* const, std::string> > >&,
llvm::SlotMachine*) (AsmWriter.cpp:654)
   by 0x8A8F4AA: llvm::AssemblyWriter::writeOperand(llvm::Value const*, bool)
(AsmWriter.cpp:837)
   by 0x8A91A6D: llvm::AssemblyWriter::printGlobal(llvm::GlobalVariable const*)
(AsmWriter.cpp:959)
   by 0x8A92079: llvm::AssemblyWriter::printModule(llvm::Module const*)
(AsmWriter.cpp:908)


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