[LLVMbugs] [Bug 10056] New: PassManager segfault when trying to schedule custom Immutable Pass

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue May 31 13:52:25 PDT 2011


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

           Summary: PassManager segfault when trying to schedule custom
                    Immutable Pass
           Product: new-bugs
           Version: 2.9
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: michael at lunarg.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=6667)
 --> (http://llvm.org/bugs/attachment.cgi?id=6667)
Skeleton code

I'm in a debug build with assertions turned on for llvm-2.9, and I get a
segfault whenever I try to schedule one of my own immutable passes in a pass
manager. It seems that one of the passes that I'm scheduling (IndVarSimplify)
attempts to ask for TargetData if it's available (I'm not providing it), and
that's when it segfaults. If I split that pass into it's own pass manager, then
everything works fine. Attached is skeleton code that exposes this. Below is
some stack traces for the run functions in Run.h and Run.cpp

RunDoesntWork stacktrace:
#0  0x083af2ed in std::vector<llvm::PassInfo const*,
std::allocator<llvm::PassInfo const*> >::begin (this=0x10) at
/usr/include/c++/4.4/bits/stl_vector.h:435
#1  0x083a6fb8 in llvm::PMTopLevelManager::findAnalysisPass (this=0x87e1d9c,
AID=0x85f0f60) at
/home/michael/LunarGLASS/LLVM/llvm-2.9/lib/VMCore/PassManager.cpp:673
#2  0x083a6d21 in llvm::PMTopLevelManager::schedulePass (this=0x87e1d9c,
P=0x867dff0) at
/home/michael/LunarGLASS/LLVM/llvm-2.9/lib/VMCore/PassManager.cpp:614
#3  0x083ad434 in llvm::PassManagerImpl::add (this=0x87e1cc8, P=0x867dff0) at
/home/michael/LunarGLASS/LLVM/llvm-2.9/lib/VMCore/PassManager.cpp:396
#4  0x083ab475 in llvm::PassManager::addImpl (this=0xbffe9568, P=0x867dff0) at
/home/michael/LunarGLASS/LLVM/llvm-2.9/lib/VMCore/PassManager.cpp:1659
#5  0x083ab59a in llvm::PassManager::add (this=0xbffe9568, P=0x867dff0) at
/home/michael/LunarGLASS/LLVM/llvm-2.9/lib/VMCore/PassManager.cpp:1672
#6  0x0809a257 in RunDoesntWork (module=0x85fdeb8) at
../LunarGLASS/Passes/Immutable/tmp/Run.cpp:34
#7  0x0808fcd3 in gla::PrivateManager::runLLVMOptimizations1 (this=0x85fd5c0)
at ../LunarGLASS/TopToBottom.cpp:272
#8  0x0808f42f in gla::PrivateManager::translateTopToBottom (this=0x85fd5c0) at
../LunarGLASS/TopToBottom.cpp:69
#9  0x08107097 in main (argc=2, argv=0xbffff184) at main.cpp:394

RunDoesntWork2 stacktrace:
#0  0x083af399 in std::vector<llvm::PassInfo const*,
std::allocator<llvm::PassInfo const*> >::begin (this=0x10) at
/usr/include/c++/4.4/bits/stl_vector.h:435
#1  0x083a7064 in llvm::PMTopLevelManager::findAnalysisPass (this=0x87e1d9c,
AID=0x85f0f30) at
/home/michael/LunarGLASS/LLVM/llvm-2.9/lib/VMCore/PassManager.cpp:673
#2  0x083a8baa in llvm::PMDataManager::findAnalysisPass (this=0x8604e90,
AID=0x85f0f30, SearchParent=true) at
/home/michael/LunarGLASS/LLVM/llvm-2.9/lib/VMCore/PassManager.cpp:1062
#3  0x083a97a5 in llvm::AnalysisResolver::getAnalysisIfAvailable
(this=0x87d9110, ID=0x85f0f30, dir=true) at
/home/michael/LunarGLASS/LLVM/llvm-2.9/lib/VMCore/PassManager.cpp:1215
#4  0x08121b7e in llvm::Pass::getAnalysisIfAvailable<llvm::TargetData>
(this=0x87e1e70) at
/home/michael/LunarGLASS/LLVM/llvm-2.9/include/llvm/PassAnalysisSupport.h:181
#5  0x082b6ad7 in llvm::ScalarEvolution::runOnFunction (this=0x87e1e70, F=...)
at /home/michael/LunarGLASS/LLVM/llvm-2.9/lib/Analysis/ScalarEvolution.cpp:5965
#6  0x083aa90f in llvm::FPPassManager::runOnFunction (this=0x8604e80, F=...) at
/home/michael/LunarGLASS/LLVM/llvm-2.9/lib/VMCore/PassManager.cpp:1483
#7  0x083aaac9 in llvm::FPPassManager::runOnModule (this=0x8604e80, M=...) at
/home/michael/LunarGLASS/LLVM/llvm-2.9/lib/VMCore/PassManager.cpp:1503
#8  0x083aadb4 in llvm::MPPassManager::runOnModule (this=0x8619f18, M=...) at
/home/michael/LunarGLASS/LLVM/llvm-2.9/lib/VMCore/PassManager.cpp:1557
#9  0x083ab26a in llvm::PassManagerImpl::run (this=0x87e1cc8, M=...) at
/home/michael/LunarGLASS/LLVM/llvm-2.9/lib/VMCore/PassManager.cpp:1638
#10 0x083ab75b in llvm::PassManager::run (this=0xbffe9568, M=...) at
/home/michael/LunarGLASS/LLVM/llvm-2.9/lib/VMCore/PassManager.cpp:1682
#11 0x0809a314 in RunDoesntWork2 (module=0x85fdeb8) at
../LunarGLASS/Passes/Immutable/tmp/Run.cpp:52
#12 0x0808fcd3 in gla::PrivateManager::runLLVMOptimizations1 (this=0x85fd5c0)
at ../LunarGLASS/TopToBottom.cpp:272
#13 0x0808f42f in gla::PrivateManager::translateTopToBottom (this=0x85fd5c0) at
../LunarGLASS/TopToBottom.cpp:69
#14 0x08107143 in main (argc=2, argv=0xbffff184) at main.cpp:394

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