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

Compilation error with hip-clang with debug symbols #1333

Closed
davidrohr opened this issue Aug 15, 2019 · 1 comment
Closed

Compilation error with hip-clang with debug symbols #1333

davidrohr opened this issue Aug 15, 2019 · 1 comment

Comments

@davidrohr
Copy link
Contributor

The attached test-case fails if I compile it with hip-clang with debug symbols.
I followed the recipe from #1196 to build hip-clang (based on ROCm 2.7 installation).
Some points I already found out:

  • The error appears only when the GPU code is in a shared library which I open with dlopen, if I put the GPU code in the executable or if I link to the library directly, it works.
  • The problem appears only when I set the -g debug settings on the command line.
  • The error appears only when the kernel has that empty shared memory object, although it is not used.
  • The failure does not appear with hcc as HIP_COMPILER, only with clang.
    testcase.tar.gz
    The failure shows up as the following gdb stacktrace:
terminate called after throwing an instance of 'std::exception'
  what():  std::exception

Thread 1 "test" received signal SIGABRT, Aborted.
0x00007ffff7d6500b in raise () from /lib64/libc.so.6
(gdb) bt
#0  0x00007ffff7d6500b in raise () from /lib64/libc.so.6
#1  0x00007ffff7d4e535 in abort () from /lib64/libc.so.6
#2  0x00007ffff71de71c in __gnu_cxx::__verbose_terminate_handler () at /var/tmp/portage/sys-devel/gcc-9.1.0-r1/work/gcc-9.1.0/libstdc++-v3/libsupc++/vterminate.cc:95
#3  0x00007ffff720e436 in __cxxabiv1::__terminate (handler=<optimized out>) at /var/tmp/portage/sys-devel/gcc-9.1.0-r1/work/gcc-9.1.0/libstdc++-v3/libsupc++/eh_terminate.cc:47
#4  0x00007ffff720e481 in std::terminate () at /var/tmp/portage/sys-devel/gcc-9.1.0-r1/work/gcc-9.1.0/libstdc++-v3/libsupc++/eh_terminate.cc:57
#5  0x00007ffff720e6b3 in __cxxabiv1::__cxa_throw (obj=<optimized out>, tinfo=0x7ffff7398f78 <typeinfo for std::exception>, dest=0x7ffff720d660 <std::exception::~exception()>) at /var/tmp/portage/sys-devel/gcc-9.1.0-r1/work/gcc-9.1.0/libstdc++-v3/libsupc++/eh_throw.cc:95
#6  0x00007ffff755dabf in hip_impl::hip_throw(std::exception const&) () from /opt/rocm/hip/lib/libhip_hcc.so
#7  0x00007ffff753b9ea in hip_impl::program_state_impl::associate_code_object_symbols_with_host_allocation(ELFIO::elfio const&, ELFIO::section*, hsa_agent_s, hsa_executable_s) () from /opt/rocm/hip/lib/libhip_hcc.so
#8  0x00007ffff7535681 in hip_impl::program_state_impl::load_executable(char const*, unsigned long, hsa_executable_s, hsa_agent_s) () from /opt/rocm/hip/lib/libhip_hcc.so
#9  0x00007ffff7545549 in __hipRegisterFatBinary () from /opt/rocm/hip/lib/libhip_hcc.so
#10 0x00007ffff7fc633e in __hip_module_ctor () from ./foo.so
#11 0x00007ffff7fe438a in call_init.part () from /lib64/ld-linux-x86-64.so.2
#12 0x00007ffff7fe4486 in _dl_init () from /lib64/ld-linux-x86-64.so.2
#13 0x00007ffff7fe82e3 in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
#14 0x00007ffff7e6faff in _dl_catch_exception () from /lib64/libc.so.6
#15 0x00007ffff7fe7bca in _dl_open () from /lib64/ld-linux-x86-64.so.2
#16 0x00007ffff7f5729a in dlopen_doit () from /lib64/libdl.so.2
#17 0x00007ffff7e6faff in _dl_catch_exception () from /lib64/libc.so.6
#18 0x00007ffff7e6fb8f in _dl_catch_error () from /lib64/libc.so.6
#19 0x00007ffff7f57b1d in _dlerror_run () from /lib64/libdl.so.2
#20 0x00007ffff7f57346 in dlopen () from /lib64/libdl.so.2
#21 0x0000555555555185 in main ()
@davidrohr
Copy link
Contributor Author

I have retried with the current amd-common branch of clang / llvm and the error is gone.
Closing this.

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