选择与 irtranslator 通行证崩溃
Posted
技术标签:
【中文标题】选择与 irtranslator 通行证崩溃【英文标题】:opt with irtranslator pass crashes 【发布时间】:2020-05-07 23:12:08 【问题描述】:当我使用 irtranslator pass 运行 opt 时,我不断收到段错误。这是我一直在运行的一个变体:
opt -debug -mcpu=x86-64 -S sample.bc --irtranslator
其他说明:
sample.bc 是一个简单的 hello world 函数,我用 clang 编译成 llvm 字节码 诸如 --instcombine 之类的一些传递确实有效 我正在使用从源代码构建的 llvm 版本LLVM (http://llvm.org/):
LLVM version 11.0.0git
DEBUG build with assertions.
Default target: x86_64-unknown-linux-gnu
Host CPU: haswell
堆栈跟踪:
Stack dump:
0. Program arguments: ../llvm10/build/bin/opt -debug -mcpu=x86-64 -S sample.bc --x86-codegen
#0 0x00007fec32c271c7 llvm::sys::PrintStackTrace(llvm::raw_ostream&) llvm/lib/Support/Unix/Signals.inc:564:0
#1 0x00007fec32c2725a PrintStackTraceSignalHandler(void*) llvm/lib/Support/Unix/Signals.inc:625:0
#2 0x00007fec32c24ff5 llvm::sys::RunSignalHandlers() llvm/lib/Support/Signals.cpp:68:0
#3 0x00007fec32c26b44 SignalHandler(int) llvm/lib/Support/Unix/Signals.inc:406:0
#4 0x00007fec2dff2890 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
#5 0x00007fec31c6e750 llvm::MachineModuleInfo::MachineModuleInfo(llvm::LLVMTargetMachine const*) llvm/lib/CodeGen/MachineModuleInfo.cpp:194:0
#6 0x00007fec31c6eddb llvm::MachineModuleInfoWrapperPass::MachineModuleInfoWrapperPass(llvm::LLVMTargetMachine const*) llvm/lib/CodeGen/MachineModuleInfo.cpp:295:0
#7 0x00007fec31c7099b llvm::Pass* llvm::callDefaultCtor<llvm::MachineModuleInfoWrapperPass>() llvm/include/llvm/PassSupport.h:80:0
#8 0x00007fec32192938 llvm::PassInfo::createPass() const llvm/include/llvm/PassInfo.h:102:0
#9 0x00007fec3218a9a2 llvm::PMTopLevelManager::schedulePass(llvm::Pass*) llvm10/llvm/lib/IR/LegacyPassManager.cpp:702:0
#10 0x00007fec3218aa07 llvm::PMTopLevelManager::schedulePass(llvm::Pass*) llvm/lib/IR/LegacyPassManager.cpp:706:0
#11 0x00007fec321933de llvm::legacy::PassManagerImpl::add(llvm::Pass*) llvm/lib/IR/LegacyPassManager.cpp:500:0
#12 0x00007fec3218f709 llvm::legacy::PassManager::add(llvm::Pass*) llvm/lib/IR/LegacyPassManager.cpp:1721:0
#13 0x00007fec2ff8650d OptCustomPassManager::add(llvm::Pass*) llvm/tools/opt/opt.cpp:340:0
#14 0x00007fec2ff7e9de addPass(llvm::legacy::PassManagerBase&, llvm::Pass*) llvm/tools/opt/opt.cpp:375:0
#15 0x00007fec2ff81013 main llvm/tools/opt/opt.cpp:862:0
#16 0x00007fec2cc51b97 __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#17 0x00007fec2ff5150a _start (../llvm10/build/bin/opt+0x195150a)
Segmentation fault (core dumped)
【问题讨论】:
【参考方案1】:IRTranslator 是在代码生成期间使用的通道。您不应该直接通过 opt 运行它。
【讨论】:
以上是关于选择与 irtranslator 通行证崩溃的主要内容,如果未能解决你的问题,请参考以下文章
送书|Java通行证:用一本书全面介绍Java多线程编程技术
如何使用 gmail api 使用 nodemailer smtp oauth2?收到错误 535:不接受用户和通行证