llvm MemDepPrinter段错误
直到我尝试使用MemDepPrinter.cpp时,我用LLVM已经存在的通行证没有问题:http://llvm.org/doxygen/MemDepPrinter_8cpp_source.html。 我得到了以下段错误:
llvm[0]: Compiling MyMemDepPrinter.cpp for Release+Asserts build (PIC)
llvm[0]: Linking Release+Asserts Loadable Module MyMemDepPrinter.so
WARNING: You're attempting to print out a bitcode file.
This is inadvisable as it may cause display problems. If
you REALLY want to taste LLVM bitcode first-hand, you
can force output with the `-f' option.
0 opt 0x08eaf9a8
1 opt 0x08eaff24
2 0xb7753400 __kernel_sigreturn + 0
3 opt 0x08c00c19 llvm::MemoryDependenceAnalysis::getNonLocalPointerDepFromBB(llvm::PHITransAddr const&, llvm::AliasAnalysis::Location const&, bool, llvm::BasicBlock*, llvm::SmallVectorImpl<llvm::NonLocalDepResult>&, llvm::DenseMap<llvm::BasicBlock*, llvm::Value*, llvm::DenseMapInfo<llvm::BasicBlock*> >&, bool) + 3673
4 opt 0x08c019aa llvm::MemoryDependenceAnalysis::getNonLocalPointerDependency(llvm::AliasAnalysis::Location const&, bool, llvm::BasicBlock*, llvm::SmallVectorImpl<llvm::NonLocalDepResult>&) + 266
5 opt 0x08bf1bed
6 opt 0x08e3415c llvm::FPPassManager::runOnFunction(llvm::Function&) + 636
7 opt 0x08e341c8 llvm::FPPassManager::runOnModule(llvm::Module&) + 56
8 opt 0x08e33de4 llvm::MPPassManager::runOnModule(llvm::Module&) + 692
9 opt 0x08e37270 llvm::PassManagerImpl::run(llvm::Module&) + 240
10 opt 0x08e37386 llvm::PassManager::run(llvm::Module&) + 38
11 opt 0x081a290f main + 6095
12 libc.so.6 0xb74604d3 __libc_start_main + 243
13 opt 0x081b8509
Stack dump:
0. Program arguments: //home/alex/llvm/Release+Asserts/bin/opt -load //home/alex/llvm/Release+Asserts/lib/MyMemDepPrinter.so -memdep -print-memdeps //home/alex/llvm/tools/clang/woRKSPACE/Test.bc
1. Running pass 'Function Pass Manager' on module '//home/alex/llvm/tools/clang/woRKSPACE/Test.bc'.
2. Running pass 'Print MemDeps of function' on function '@_Z9deadcode1i'
./run.sh: line 14: 3326 Segmentation fault (core dumped) //home/alex/llvm/Release+Asserts/bin/opt -load //home/alex/llvm/Release+Asserts/lib/MyMemDepPrinter.so -print-memdeps //home/alex/llvm/tools/clang/woRKSPACE/Test.bc
当我以GDB模式运行它时,我得到:
Program received signal SIGSEGV, Segmentation fault.
0x08c00c19 in llvm::MemoryDependenceAnalysis::getNonLocalPointerDepFromBB(llvm::PHITransAddr const&, llvm::AliasAnalysis::Location const&, bool, llvm::BasicBlock*, llvm::SmallVectorImpl<llvm::NonLocalDepResult>&, llvm::DenseMap<llvm::BasicBlock*, llvm::Value*, llvm::DenseMapInfo<llvm::BasicBlock*> >&, bool) ()
(gdb) x/i $pc
=> 0x8c00c19 <_ZN4llvm24MemoryDependenceAnalysis27getNonLocalPointerDepFromBBERKNS_12PHITransAddrERKNS_13AliasAnalysis8LocationEbPNS_10BasicBlockERNS_15SmallVectorImplINS_17NonLocalDepResultEEERNS_8DenseMapIS9_PNS_5ValueENS_12DenseMapInfoIS9_EEEEb+3673>: mov 0x10(%eax),%eax
作为更新,线路问题是:
MDA.getNonLocalPointerDependency(Loc, true, LI->getParent(), NLDI);
而不是4个参数是问题。 所有这些都已定义,我可以使用它们。 我没有segfault,如果我消除线。
我认为这个问题是在评论中定义的:
FIXME: Handle atomic/volatile loads.
请告诉我怎样才能解决问题(也许提出一个条件,以避免原子/挥发性负载),或者如果通行证对你工作正常,如果是这样,你如何使用它。
谢谢 !
我看到了另一个更新的帖子,所以我认为我更好地尝试手动依赖。 这不是第一次在开源代码中出现错误。 我试图运行通行证,我有同样的问题。 getNonLocalPointerDependency方法的相同问题也会出现在其他指令类型中,例如store,不仅在您提到的地方。
链接地址: http://www.djcxy.com/p/68689.html上一篇: llvm MemDepPrinter segfault
下一篇: Xcode debugger doesn't work for a project with multiple targets