llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

loop-extractor infinite memory usage

Open llvmbot opened this issue 18 years ago • 15 comments

Bugzilla Link 3082
Resolution FIXED
Resolved on Apr 24, 2020 11:17
Version trunk
OS Linux
Attachments testcase
Reporter LLVM Bugzilla Contributor
CC @anmparal,@coffezhou,@ekatz
Fixed by commit(s) rG3b70ee27a503

Extended Description

This is a reduction of the testcase in bug 3081. This runs out of memory:

opt -mergereturn -loop-extract -jump-threading bugpoint-reduced-simplified.bc

Here's the stack trace:

#​0 0x086747cc in llvm::StringMapEntryllvm::Value*::Create<llvm::MallocAllocator, void*> ( KeyStart=0x26b21d04 "bb190.i.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exi"..., KeyEnd=0x26b2e779 "", Allocator=@0x202143ac, InitVal=0x0) at /usr/local/src/llvm/include/llvm/ADT/StringMap.h:174 #​1 0x08675490 in llvm::StringMap<llvm::Value*, llvm::MallocAllocator>::GetOrCreateValue<void*> (this=0x20214398, KeyStart=0x26b21d04 "bb190.i.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exi"..., KeyEnd=0x26b2e779 "", Val=0x0) at /usr/local/src/llvm/include/llvm/ADT/StringMap.h:362 #​2 0x0867551f in llvm::StringMap<llvm::Value*, llvm::MallocAllocator>::GetOrCreateValue (this=0x20214398, KeyStart=0x26b21d04 "bb190.i.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exi"..., KeyEnd=0x26b2e779 "") at /usr/local/src/llvm/include/llvm/ADT/StringMap.h:379 #​3 0x08674f2e in llvm::ValueSymbolTable::createValueName (this=0x20214398, NameStart=0x26b21d04 "bb190.i.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exi"..., NameLen=51829, V=0x20233a10) at ValueSymbolTable.cpp:97 #​4 0x08673472 in llvm::Value::setName (this=0x20233a10, NameStr=0x26b21d04 "bb190.i.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exitStub.exi"..., NameLen=51829) at Value.cpp:225 #​5 0x086736e2 in llvm::Value::setName (this=0x20233a10, name=@0xffffd0d8) at Value.cpp:166 #​6 0x085f564e in BasicBlock (this=0x20233a10, Name=@0xffffd0d8, NewParent=0x20214458, InsertBefore=0x0) at BasicBlock.cpp:92 #​7 0x083afaca in llvm::BasicBlock::Create (Name=@0xffffd0d8, Parent=0x20214458, InsertBefore=0x0) at /usr/local/src/llvm/include/llvm/BasicBlock.h:82 #​8 0x084f799e in (anonymous namespace)::CodeExtractor::emitCallAndSwitchStatement (this=0xffffd2dc, newFunction=0x20214458, codeReplacer=0x202140b0, inputs=@0xffffd22c, outputs=@0xffffd220) at CodeExtractor.cpp:456 #​9 0x084f91f1 in (anonymous namespace)::CodeExtractor::ExtractCodeRegion ( this=0xffffd2dc, code=@0x1fe6ba98) at CodeExtractor.cpp:660 #​10 0x084f967f in llvm::ExtractLoop (DT=@0x87e9500, L=0x1fe6ba88, AggregateArgs=false) at CodeExtractor.cpp:733 #​11 0x083c74c6 in (anonymous namespace)::LoopExtractor::runOnFunction ( this=0x87e86a0, F=@0x20213ef8) at LoopExtractor.cpp:124 #​12 0x08651634 in llvm::FPPassManager::runOnFunction (this=0x87e83c0, F=@0x20213ef8) at PassManager.cpp:1323 #​13 0x086517de in llvm::FPPassManager::runOnModule (this=0x87e83c0, M=@0x87e7088) at PassManager.cpp:1346 #​14 0x08651301 in llvm::MPPassManager::runOnModule (this=0x87e71a0, M=@0x87e7088) at PassManager.cpp:1393 #​15 0x0865149e in llvm::PassManagerImpl::run (this=0x87e7db8, M=@0x87e7088) at PassManager.cpp:1467 #​16 0x086514f9 in llvm::PassManager::run (this=0xffffd568, M=@0x87e7088) at PassManager.cpp:1499 #​17 0x0837863b in main (argc=5, argv=0xffffd764) at opt.cpp:588

llvmbot avatar Nov 17 '08 20:11 llvmbot

mentioned in issue llvm/llvm-bugzilla-archive#40950

ekatz avatar Nov 27 '21 01:11 ekatz

mentioned in issue llvm/llvm-bugzilla-archive#40937

ekatz avatar Nov 27 '21 01:11 ekatz

mentioned in issue llvm/llvm-bugzilla-archive#40900

ekatz avatar Nov 27 '21 01:11 ekatz

mentioned in issue llvm/llvm-bugzilla-archive#40895

ekatz avatar Nov 27 '21 01:11 ekatz

*** Bug llvm/llvm-bugzilla-archive#40895 has been marked as a duplicate of this bug. ***

ekatz avatar Apr 24 '20 18:04 ekatz

*** Bug llvm/llvm-bugzilla-archive#40937 has been marked as a duplicate of this bug. ***

ekatz avatar Apr 24 '20 18:04 ekatz

*** Bug llvm/llvm-bugzilla-archive#40950 has been marked as a duplicate of this bug. ***

ekatz avatar Apr 24 '20 18:04 ekatz

*** Bug llvm/llvm-bugzilla-archive#40900 has been marked as a duplicate of this bug. ***

ekatz avatar Apr 24 '20 17:04 ekatz

Fix in https://reviews.llvm.org/D69069

ekatz avatar Oct 17 '19 17:10 ekatz

new_testcase Still reproducible in LLVM version 9.0 and today's trunk. I have attached an updated version of the testing BC.

ekatz avatar Oct 16 '19 19:10 ekatz

Thank you, will bear in mind the note on notating the snapshot revision.

anmparal avatar Feb 04 '17 03:02 anmparal

The .bc format has changed incompatibly since this bug was filed. I don't care enough to bother finding an llvm 2.5 / 2.6 series compiler to llvm-dis and upgrade it. It's unlikely the same bitcode will still trigger the same bug, even if the underlying bug is still unfixed. Closing WONTFIX.

One other thing. "748bc4973cbfe2bac372bd83fb814618e4fc3d9c" isn't a revision number. LLVM is, for now, still hosted on svn and we use svn revision numbers as a project. Even when LLVM does go to git, the plan is to use a monotonically increasing number because those are so valuable. http://llvm.org/docs/Proposals/GitHubMove.html#on-managing-revision-numbers-with-git

llvmbot avatar Feb 04 '17 03:02 llvmbot

This is not reproducible anymore (today's trunk: 748bc4973cbfe2bac372bd83fb814618e4fc3d9c) opt -mergereturn -loop-extract -jump-threading bugpoint-reduced-simplified.bc opt: bugpoint-reduced-simplified.bc: error: Invalid record

anmparal avatar Feb 04 '17 03:02 anmparal

This is still reproducible as of todays trunk.

llvmbot avatar Jan 26 '09 03:01 llvmbot

assigned to @ekatz

llvmbot avatar Nov 17 '08 20:11 llvmbot