[LLVMdev] Runtime exception in DominatorTree.getRootNode()

Bill He wh3 at rice.edu
Fri Apr 12 09:32:06 PDT 2013


Hi Cristianno,

I have used default options for configure(llvm/configure && make).

Thanks for your advice. After I set the environment var DYLD_LIBRARY_PATH
to /usr/local/lib/ ,  the exception is gone.

Somehow the library is not linked into opt for reasons I don't know.

Thank you so much for your help!

Best,
Weibo


On Fri, Apr 12, 2013 at 11:17 AM, Cristianno Martins <
cristiannomartins at gmail.com> wrote:

> Hi Weibo,
>
> I thought would be more efficient discussing here (I just saw that every
> info was replicated on both emails you were sending to me).
>
> I just run your example here on my working machine, and I didn't have any
> issues with the namespace. Just tell me one thing: which line (and flags)
> are you using when configuring and make your build llvm directory?
>
> Oh, and one more thing: what is on your $PATH?
>
> Cheers,
>
>
> --
> Cristianno Martins
> PhD Student of Computer Science
> University of Campinas
> cmartins at ic.unicamp.br
> <cristiannomartins at hotmail.com>
>
>
> On Fri, Apr 12, 2013 at 12:03 PM, John Criswell <criswell at illinois.edu>wrote:
>
>>  On 4/12/13 9:51 AM, Bill He wrote:
>>
>> Thanks for your reply, John.
>>
>>  I am using opt to run my pass. Should opt by default link in the
>> library? Would you please give me some idea on fixing it? Thanks!
>>
>>
>> Odd.  I would think that opt would have that pass linked in statically.
>>
>> I'm not sure why it's not working.  Does anyone else have an idea?
>>
>> -- John T.
>>
>>
>>
>>  opt -load ../../../Debug+Asserts/lib/LLVMHello.dylib -hello < hello.bc
>> > /dev/null
>>
>>   My pass is just:
>>
>>  #include "llvm/IR/Function.h"
>> #include "llvm/Pass.h"
>> #include "llvm/Support/raw_ostream.h"
>> #include "llvm/Analysis/Dominators.h"
>>
>>  using namespace llvm;
>>
>>  namespace {
>>   struct Hello : public FunctionPass {
>>     static char ID;
>>     Hello() : FunctionPass(ID) { }
>>     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
>>       AU.addRequired<DominatorTree>();
>>     }
>>     virtual bool runOnFunction(Function &F) {
>>       DominatorTree& DT = getAnalysis<DominatorTree>();
>>       BasicBlock* BB = DT.getRoot();
>>       return false;
>>     }
>>   };
>> }
>> char Hello::ID = 0;
>> static RegisterPass<Hello> Z("hello", "My test analysis", true, true);
>>
>>
>> On Fri, Apr 12, 2013 at 9:32 AM, John Criswell <criswell at illinois.edu>wrote:
>>
>>>  On 4/11/13 10:30 PM, Bill He wrote:
>>>
>>> Hi all,
>>>
>>>  I am trying to traverse a dominator tree and have encountered a weird
>>> runtime exception:
>>>
>>>  Here's my simple code:
>>>
>>>      virtual bool runOnFunction(Function &F) {
>>>       DominatorTree& DT = getAnalysis<DominatorTree>();
>>>
>>>    *    DomTreeNode* rootNode = DT.getRootNode();*
>>>       return false.
>>> }
>>>
>>>  Here's the documentation page:
>>> http://llvm.org/docs/doxygen/html/classllvm_1_1DominatorTree.html
>>>
>>>  And here's my runtime exception:
>>>  dyld: lazy symbol binding failed: Symbol not found:
>>> __ZN4llvm17DominatorTreeBaseINS_10BasicBlockEE11getRootNodeEv
>>>   Referenced from:
>>> /Users/weibohe/Projects/llvm/llvm/Debug+Asserts/lib/LLVMSLVN.dylib
>>>
>>>
>>>  How are you running your pass?  Based on the error, it looks like
>>> whatever tool you're using to run your pass doesn't have the library
>>> defining the DominatorTree code linked in.
>>>
>>> -- John T.
>>>
>>>      Expected in: flat namespace
>>>
>>>  dyld: Symbol not found:
>>> __ZN4llvm17DominatorTreeBaseINS_10BasicBlockEE11getRootNodeEv
>>>   Referenced from:
>>> /Users/weibohe/Projects/llvm/llvm/Debug+Asserts/lib/LLVMSLVN.dylib
>>>   Expected in: flat namespace
>>>
>>>  0  opt               0x0000000105f528de
>>> llvm::sys::PrintStackTrace(__sFILE*) + 46
>>> 1  opt               0x0000000105f52beb
>>> _ZL28PrintStackTraceSignalHandlerPv + 27
>>> 2  opt               0x0000000105f52ef9 _ZL13SignalHandleri + 297
>>> 3  libsystem_c.dylib 0x00007fff90d32cfa _sigtramp + 26
>>> 4  libsystem_c.dylib 0xfffffffffffffff8 _sigtramp + 1865208600
>>> 5  libsystem_c.dylib 0x00007fff64a41948 _sigtramp + 3553684584
>>> 6  libdyld.dylib     0x00007fff8afe2716 dyld_stub_binder_ + 13
>>> 7  LLVMSLVN.dylib    0x00000001081a8040 void
>>> std::__destroy_aux<llvm::PassInfo const**>(llvm::PassInfo const**,
>>> llvm::PassInfo const**, std::__true_type) + 19904
>>> 8  LLVMSLVN.dylib    0x00000001081998c1 (anonymous
>>> namespace)::DVN::runOnFunction(llvm::Function&) + 65
>>> 9  opt               0x0000000105eb27b2
>>> llvm::FPPassManager::runOnFunction(llvm::Function&) + 434
>>> 10 opt               0x0000000105eb2a98
>>> llvm::FPPassManager::runOnModule(llvm::Module&) + 104
>>> 11 opt               0x0000000105eb2e9a
>>> llvm::MPPassManager::runOnModule(llvm::Module&) + 634
>>>  12 opt               0x0000000105eb36ae
>>> llvm::PassManagerImpl::run(llvm::Module&) + 302
>>> 13 opt               0x0000000105eb3951
>>> llvm::PassManager::run(llvm::Module&) + 33
>>> 14 opt               0x0000000104e4d335 main + 6549
>>> 15 opt               0x0000000104e3e434 start + 52
>>> Stack dump:
>>> 0. Program arguments: opt -load
>>> ../../../Debug+Asserts/lib/LLVMSLVN.dylib -dvn
>>> 1. Running pass 'Function Pass Manager' on module '<stdin>'.
>>> 2. Running pass 'My test analysis' on function '@main'
>>>
>>>
>>>  Any idea on why this is happening? Any help or suggestion is
>>> appreciated! Thanks in advance.
>>>
>>>  Best,
>>> Weibo
>>>
>>>
>>>
>>>  _______________________________________________
>>> LLVM Developers mailing listLLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>>
>>>
>>>
>>
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130412/f40111a3/attachment.html>


More information about the llvm-dev mailing list