LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 1177 - LCSSA is broken due to use of DenseMap
Summary: LCSSA is broken due to use of DenseMap
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Support Libraries (show other bugs)
Version: trunk
Hardware: PC Linux
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords: compile-fail
Depends on:
Blocks:
 
Reported: 2007-02-04 23:03 PST by Reid Spencer
Modified: 2010-03-06 13:59 PST (History)
1 user (show)

See Also:
Fixed By Commit(s):


Attachments
valgrind output from "opt" (138.61 KB, text/plain)
2007-02-04 23:05 PST, Reid Spencer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Reid Spencer 2007-02-04 23:03:12 PST
I'm getting this glibc detected failure:
/proj/llvm/llvm-3/Debug/bin/opt: malloc(): memory corruption: 0x08de9f1c

Occurring at:

llvm::DenseMap<llvm::DominatorTreeBase::Node*,llvm::Value*>::grow()+0x34
llvm::DenseMap<llvm::DominatorTreeBase::Node*,llvm::Value*>::InsertIntoBucket(llvm::DominatorTreeBase::Node*
const&, llvm::Value* const&, std::pair<llvm::DominatorTreeBase::Node*,
llvm::Value*>*)
llvm::DenseMap<llvm::DominatorTreeBase::Node*,llvm::Value*>::operator[](llvm::DominatorTreeBase::Node*
const&)
(anonymous
namespace)::LCSSA::GetValueForBlock(llvm::DominatorTreeBase::Node*,llvm::Instruction*,
llvm::DenseMap<llvm::DominatorTreeBase::Node*, llvm::Value*>&)
(anonymous
namespace)::LCSSA::ProcessInstruction(llvm::Instruction*,std::vector<llvm::BasicBlock*,
std::allocator<llvm::BasicBlock*> > const&)
(anonymous namespace)::LCSSA::visitSubloop(llvm::Loop*)
(anonymous namespace)::LCSSA::visitSubloop(llvm::Loop*)
(anonymous namespace)::LCSSA::runOnFunction(llvm::Function&)
llvm::FPPassManager::runOnFunction(llvm::Function&)
CGPassManager::runOnModule(llvm::Module&)
llvm::MPPassManager::runOnModule(llvm::Module&)
llvm::PassManagerImpl::run(llvm::Module&)
llvm::PassManager::run(llvm::Module&)
main
Comment 1 Chris Lattner 2007-02-04 23:04:37 PST
can you run valgrind on it plz?
Comment 2 Reid Spencer 2007-02-04 23:05:32 PST
Created attachment 646 [details]
valgrind output from "opt" 

This is the output of valgrind when opt is run as:

valgrind opt -std-compile-opts Output/rem.linked.rbc -o Output/rem.linked.bc -f


in llvm-test/SingleSource/UnitTests/SignlessTypes
Comment 3 Chris Lattner 2007-02-04 23:13:01 PST
This is because LCSSA is using invalidated iterators.
Comment 4 Reid Spencer 2007-02-04 23:25:29 PST
Reverting this patch fixed the problem:

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070129/043914.html

Resolved.