This is an archive of the discontinued LLVM Phabricator instance.

[ORC] Minor renaming and typo fixes (NFC)
ClosedPublic

Authored by sgraenitz on Sep 22 2021, 8:53 AM.

Details

Summary

One typo, one unsused include and some leftovers from the TargetProcessControl -> ExecutorProcessControl renaming

Diff Detail

Event Timeline

sgraenitz created this revision.Sep 22 2021, 8:53 AM
sgraenitz requested review of this revision.Sep 22 2021, 8:53 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptSep 22 2021, 8:53 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
xgupta added a subscriber: xgupta.Sep 23 2021, 4:35 AM

Although this patch is correct, running ./LLJITWithTargetProcessControl result in segmentation fault.

PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0. Program arguments: ./LLJITWithTargetProcessControl
#0 0x00007fdee365ab73 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/xgupta/llvm/llvm-upstream/build/bin/../lib/libLLVMSupport.so.14git+0x1f6b73)
#1 0x00007fdee365892e llvm::sys::RunSignalHandlers() (/home/xgupta/llvm/llvm-upstream/build/bin/../lib/libLLVMSupport.so.14git+0x1f492e)
#2 0x00007fdee365b03a SignalHandler(int) Signals.cpp:0:0
#3 0x00007fdee3c16870 restore_rt sigaction.c:0:0
#4 0x00007fdee461a9e4 llvm::orc::EPCIndirectionUtils::Create(llvm::orc::ExecutorProcessControl&) (/home/xgupta/llvm/llvm-upstream/build/bin/../lib/libLLVMOrcJIT.so.14git+0xfb9e4)
#5 0x0000000000208781 main (./LLJITWithTargetProcessControl+0x208781)
#6 0x00007fdee2f48b25
libc_start_main (/usr/lib/libc.so.6+0x27b25)
#7 0x0000000000207fde _start (./LLJITWithTargetProcessControl+0x207fde)
[1] 52081 segmentation fault (core dumped) ./LLJITWithTargetProcessControl

Thanks @xgupta for your note! The parameter passed to EPCIndirectionUtils::Create() in the example was referencing a moved-from value. This caused the segfault. Unfortunately, the examples don't have good test coverage so far.

xgupta accepted this revision.Sep 23 2021, 9:14 AM

Thanks @xgupta for your note! The parameter passed to EPCIndirectionUtils::Create() in the example was referencing a moved-from value. This caused the segfault. Unfortunately, the examples don't have good test coverage so far.

Yeah we need testcases, now it says

JIT session error: Symbols not found: [ return1 ]
JIT session error: Failed to materialize symbols: { (main, { foo_body }) }
Unable to lazily compile function. Exiting.

Anyways the current patch LGTM.

This revision is now accepted and ready to land.Sep 23 2021, 9:14 AM

Yeah we need testcases, now it says

JIT session error: Symbols not found: [ return1 ]
JIT session error: Failed to materialize symbols: { (main, { foo_body }) }
Unable to lazily compile function. Exiting.

Interesting, it does work for me now on macOS with both, shared libs on and off. Can you please check if you get something like this as well:

➜ nm bin/LLJITWithExecutorProcessControl | grep return1
0000000100004c10 T _return1
xgupta added a comment.EditedSep 23 2021, 10:19 AM

Interesting, it does work for me now on macOS with both, shared libs on and off. Can you please check if you get something like this as well:

➜ nm bin/LLJITWithExecutorProcessControl | grep return1
0000000100004c10 T _return1

nothing returns, I am on arch linux (an rolling release distribution which has all the latest packages) and building LLVM with shared libs config.
cmake ../llvm -DLLVM_TARGETS_TO_BUILD="X86" -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_TOOLS=ON -DLLVM_USE_LINKER=lld -DBUILD_SHARED_LIBS=ON -DCMAKE_C_COMPILER=/usr/local/bin/clang \
-DCMAKE_CXX_COMPILER=/usr/local/bin/clang++ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DLLVM_BUILD_EXAMPLES=ON

Problem is fixed with D110345, Thank you very much for quick fixes.

This revision was landed with ongoing or failed builds.Sep 23 2021, 12:34 PM
This revision was automatically updated to reflect the committed changes.

FYI Included one more typo fix in ExecutorAddress.h

llvm/examples/OrcV2Examples/CMakeLists.txt