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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

buffer_manager causes a segment fault #19

Closed
CSalih opened this issue Oct 26, 2020 · 3 comments 路 Fixed by #20
Closed

buffer_manager causes a segment fault #19

CSalih opened this issue Oct 26, 2020 · 3 comments 路 Fixed by #20

Comments

@CSalih
Copy link

CSalih commented Oct 26, 2020

Describe the bug 馃挜
Some weird error.
Building celerity_runtime with the examples and tests works just fine. All runtime tests passes and the examples runs also fine.
Now the weird think, add_celerity_to_target cause a segment fault when it try's to create a celerity::buffer. The segment fault occur in buffer_manager.h on line 130.

To Reproduce 馃攣
Steps to reproduce the behavior:

  1. Open CMakeList.txt of any example
  2. Add find_package(Celerity 0.2.1 REQUIRED CONFIG HINTS "/opt/celerity/lib")
  3. Remove target_link_libraries and add_sycl_to_target
  4. Add (for matmul as example)
add_celerity_to_target(
  TARGET matmul
  SOURCES matmul.cc
)
  1. Build and run

Output

[2020-10-26 21:06:53.208] [default] [info] [rank = 0] sycl = hipSYCL 0.8.2, build = release, pid = 12708, event = initialized
[2020-10-26 21:06:53.220] [default] [info] [rank = 0] Using platform 'hipSYCL [SYCL over CUDA/HIP] on NVIDIA CUDA', device 'GeForce GTX 1050' (automatically selected platform 0, device 0)
[2020-10-26 21:06:53.280] [bench] [info] [rank = 0] event = userConfig, matSize = 1024
[XPS-15-9560:12708] *** Process received signal ***
[XPS-15-9560:12708] Signal: Segmentation fault (11)
[XPS-15-9560:12708] Signal code: Address not mapped (1)
[XPS-15-9560:12708] Failing at address: 0x71
[XPS-15-9560:12708] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7f92c81723c0]
[XPS-15-9560:12708] [ 1] /home/salih/projects/c++/celerity-runtime/cmake-build-debug/examples/matmul/matmul[0x434973]
[XPS-15-9560:12708] [ 2] /home/salih/projects/c++/celerity-runtime/cmake-build-debug/examples/matmul/matmul[0x433ebd]
[XPS-15-9560:12708] [ 3] /home/salih/projects/c++/celerity-runtime/cmake-build-debug/examples/matmul/matmul[0x433b8c]
[XPS-15-9560:12708] [ 4] /home/salih/projects/c++/celerity-runtime/cmake-build-debug/examples/matmul/matmul[0x433a35]
[XPS-15-9560:12708] [ 5] /home/salih/projects/c++/celerity-runtime/cmake-build-debug/examples/matmul/matmul[0x42d4f5]
[XPS-15-9560:12708] [ 6] /home/salih/projects/c++/celerity-runtime/cmake-build-debug/examples/matmul/matmul[0x42cff9]
[XPS-15-9560:12708] [ 7] /home/salih/projects/c++/celerity-runtime/cmake-build-debug/examples/matmul/matmul[0x429641]
[XPS-15-9560:12708] [ 8] /home/salih/projects/c++/celerity-runtime/cmake-build-debug/examples/matmul/matmul[0x4291d7]
[XPS-15-9560:12708] [ 9] /home/salih/projects/c++/celerity-runtime/cmake-build-debug/examples/matmul/matmul[0x41fd94]
[XPS-15-9560:12708] [10] /home/salih/projects/c++/celerity-runtime/cmake-build-debug/examples/matmul/matmul[0x41a51c]
[XPS-15-9560:12708] [11] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7f92c7c470b3]
[XPS-15-9560:12708] [12] /home/salih/projects/c++/celerity-runtime/cmake-build-debug/examples/matmul/matmul[0x41a28e]
[XPS-15-9560:12708] *** End of error message ***

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

Environment 馃寧

  • OS: Ubuntu 20.04
  • Sycl: hipSYCL 0.8.2
  • Celerity: 0.2.1
  • Clang 10 and CUDA 10.1
@psalz
Copy link
Member

psalz commented Oct 27, 2020

Ah yes, the problem here is that you are building your matmul executable as debug, while linking to a release version of Celerity. We currently have a bug where the buffer_manager has a different size in debug and release builds, which causes this crash. I haven't gotten around to fixing this yet, but I'll do it now!

@psalz
Copy link
Member

psalz commented Oct 27, 2020

I've just pushed a fix for this in #20, please give it a try!

@CSalih
Copy link
Author

CSalih commented Oct 27, 2020

Thank you for this quick fix!
This PR fixes this problem 馃憤

@psalz psalz closed this as completed in #20 Dec 14, 2020
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

Successfully merging a pull request may close this issue.

2 participants