ROCm / HIP

HIP: C++ Heterogeneous-Compute Interface for Portability
https://rocmdocs.amd.com/projects/HIP/
MIT License
3.73k stars 529 forks source link

Compilation error with hip-clang with debug symbols #1333

Closed davidrohr closed 5 years ago

davidrohr commented 5 years ago

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:

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=) 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=, tinfo=0x7ffff7398f78 , 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 commented 5 years ago

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