Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hello-opt segmentation fault #34

Open
benroywillis opened this issue Aug 27, 2023 · 0 comments
Open

hello-opt segmentation fault #34

benroywillis opened this issue Aug 27, 2023 · 0 comments

Comments

@benroywillis
Copy link

After successfully compiling mlir-hello on Ubuntu 18.04.4 LTS (with Linux kernel 4.15.0-101-generix x86_64) with the following configurations:

(using the llvm version in the update-llvm-2023-08-24 branch)
source ~/.unset ; $CMAKE ../llvm/ -G Ninja -DLLVM_ENABLE_PROJECTS="clang;polly;mlir;lld;openmp;lldb" -DCMAKE_INSTALL_PREFIX=/mnt/heorot-10/Installs/LLVM18/release/ -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_RTTI=ON -DLLVM_BUILD_EXAMPLES=ON -DLLVM_TARGETS_TO_BUILD="Native;NVPTX;AMDGPU" -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_INSTALL_UTILS=ON

Then I installed this LLVM build and set the environment to use it:
export LLVM_ROOT=${INSTALLS_HOME}LLVM18/release/
export CC=${LLVM_ROOT}bin/clang
export CXX=${LLVM_ROOT}bin/clang++
export LLD=${LLVM_ROOT}bin/ld.lld

mlir-hello:
$CMAKE ../ -G Ninja -DLLVM_DIR=/mnt/heorot-10/Installs/LLVM18/release/lib/cmake/llvm/ -DMLIR_DIR=/mnt/heorot-10/Installs/LLVM18/release/lib/cmake/mlir/
this builds mlir-hello successfully

When running build/bin/hello-opt on test/Hello/hello_world.mlir (and print.mlir) I get a segmentation fault.

Running with lldb, I get the following output:
$LLVM_ROOT/bin/lldb ./build/bin/hello-opt test/Hellow/hello_world.mlir(lldb) target create "./build/bin/hello-opt"
Current executable set to '/mnt/heorot-10/Builds/mlir-hello/build/bin/hello-opt' (x86_64).
(lldb) settings set -- target.run-args "test/Hellow/hello_world.mlir"
(lldb) r
Process 32290 launched: '/mnt/heorot-10/Builds/mlir-hello/build/bin/hello-opt' (x86_64)
Process 32290 stopped

  • thread Catch up latest mlir #1, name = 'hello-opt', stop reason = signal SIGSEGV: address not mapped to object (fault address: 0x1)
    frame #0: 0x0000555558b702aa hello-optllvm::MemoryBuffer::getFileOrSTDIN(llvm::Twine const&, bool, bool, std::optional<llvm::Align>) + 138 hello-optllvm::MemoryBuffer::getFileOrSTDIN:
    -> 0x555558b702aa <+138>: movzbl 0x1(%r13), %r15d
    0x555558b702af <+143>: testb %r15b, %r15b
    0x555558b702b2 <+146>: je 0x555558b702c1 ; <+161>
    0x555558b702b4 <+148>: movzbl (%r13), %eax
    and the function call stack:
    (lldb) bt
  • thread Catch up latest mlir #1, name = 'hello-opt', stop reason = signal SIGSEGV: address not mapped to object (fault address: 0x1)
    • frame #0: 0x0000555558b702aa hello-optllvm::MemoryBuffer::getFileOrSTDIN(llvm::Twine const&, bool, bool, std::optional<llvm::Align>) + 138 frame #1: 0x0000555555983ebc hello-optloadMLIR(context=0x00007fffffffd288, module=0x00007fffffffd280) at hello-opt.cpp:86:13
      frame Enable GitHub action to build project #2: 0x00005555559840d0 hello-optloadAndProcessMLIR(context=0x00007fffffffd288, module=0x00007fffffffd280) at hello-opt.cpp:103:19 frame #3: 0x00005555559844dd hello-optmain(argc=2, argv=0x00007fffffffd398) at hello-opt.cpp:162:19
      frame Build fails when looking for cmake dependencies "FileCheck", "count", "not", etc. #4: 0x00007ffff6652c87 libc.so.6__libc_start_main(main=(hello-optmain at hello-opt.cpp:152), argc=2, argv=0x00007fffffffd398, init=, fini=, rtld_fini=, stack_end=0x00007fffffffd388) at libc-start.c:310
      frame Add a script to compile everything #5: 0x0000555555983ada hello-opt`_start + 42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant