[LLVMbugs] [Bug 1935] New: Use of freed memory in CodeGenPrepare::OptimizeBlock

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Jan 20 01:07:54 PST 2008


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

           Summary: Use of freed memory in CodeGenPrepare::OptimizeBlock
           Product: new-bugs
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: baldrick at free.fr
                CC: llvmbugs at cs.uiuc.edu


Here's where the freed memory was used:

Invalid read of size 2
   at 0x83D3016: llvm::Value::getValueID() const (Value.h:207)
   by 0x83D32D6: llvm::Instruction::getOpcode() const (Instruction.h:104)
   by 0x8845026: llvm::ZExtInst::classof(llvm::Instruction const*)
(Instructions.h:1932)
   by 0x88454A6: bool llvm::isa_impl<llvm::ZExtInst,
llvm::Instruction>(llvm::Instruction const&) (Casting.h:54)
   by 0x88454BC: llvm::isa_impl_wrap<llvm::ZExtInst, llvm::Instruction const,
llvm::Instruction const>::doit(llvm::Instruction const&) (Casting.h:71)
   by 0x88454D2: bool
llvm::isa_impl_cl<llvm::Instruction>::isa<llvm::ZExtInst>(llvm::Instruction
const&) (Casting.h:83)
   by 0x88454E8: bool
llvm::isa_impl_cl<llvm::Instruction*>::isa<llvm::ZExtInst>(llvm::Instruction*)
(Casting.h:101)
   by 0x8845500: bool llvm::isa<llvm::ZExtInst,
llvm::Instruction*>(llvm::Instruction* const&) (Casting.h:116)
   by 0x88441BB: (anonymous
namespace)::CodeGenPrepare::OptimizeBlock(llvm::BasicBlock&)
(CodeGenPrepare.cpp:1046)
   by 0x8844F60: (anonymous
namespace)::CodeGenPrepare::runOnFunction(llvm::Function&)
(CodeGenPrepare.cpp:85)
   by 0x8937C6B: llvm::FPPassManager::runOnFunction(llvm::Function&)
(PassManager.cpp:1171)
   by 0x8937EC9: llvm::FunctionPassManagerImpl::run(llvm::Function&)
(PassManager.cpp:1129)


Here is where the memory was freed:

 Address 0x42c321c is 4 bytes inside a block of size 56 free'd
   at 0x402231C: operator delete(void*) (vg_replace_malloc.c:342)
   by 0x89249D4: llvm::TruncInst::~TruncInst() (Instructions.h:1864)
   by 0x87FD900: llvm::iplist<llvm::Instruction,
llvm::ilist_traits<llvm::Instruction>
>::erase(llvm::ilist_iterator<llvm::Instruction>) (ilist:368)
   by 0x89141A8: llvm::Instruction::eraseFromParent() (Instruction.cpp:68)
   by 0x8843C2F: OptimizeNoopCopyExpression(llvm::CastInst*,
llvm::TargetLowering const&) (CodeGenPrepare.cpp:405)
   by 0x884417A: (anonymous
namespace)::CodeGenPrepare::OptimizeBlock(llvm::BasicBlock&)
(CodeGenPrepare.cpp:1042)
   by 0x8844F60: (anonymous
namespace)::CodeGenPrepare::runOnFunction(llvm::Function&)
(CodeGenPrepare.cpp:85)
   by 0x8937C6B: llvm::FPPassManager::runOnFunction(llvm::Function&)
(PassManager.cpp:1171)
   by 0x8937EC9: llvm::FunctionPassManagerImpl::run(llvm::Function&)
(PassManager.cpp:1129)
   by 0x893801F: llvm::FunctionPassManager::run(llvm::Function&)
(PassManager.cpp:1074)
   by 0x83C3692: main (llc.cpp:296)


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