Issue |
125449
|
Summary |
[OpenMP] offload to x86 doesn't segfaults
|
Labels |
new issue
|
Assignees |
|
Reporter |
ye-luo
|
hitting segfault since 19.1.0. also tested latest main 1822462e2a0c9cc944f3ce114d8b1a71d0764350.
code `main.cpp`
```
int main()
{
#pragma omp target
{}
}
```
run and hit segfault.
```
$ clang++ -fopenmp -fopenmp-targets=x86_64-pc-linux-gnu main.cpp
$ LIBOMPTARGET_DEBUG=1 ./a.out
omptarget --> Init offload library!
OMPT --> Entering connectLibrary
OMPT --> OMPT: Trying to load library libomp.so
OMPT --> OMPT: Trying to get address of connection routine ompt_libomp_connect
OMPT --> OMPT: Library connection handle = 0x71cf2b8dba40
OMPT --> Exiting connectLibrary
omptarget --> Loading RTLs...
omptarget --> RTLs loaded!
TARGET x86_64 RTL --> Implementing ffi_call with dlsym(ffi_call) -> 0x71cf2bd07f90
TARGET x86_64 RTL --> Implementing ffi_prep_cif with dlsym(ffi_prep_cif) -> 0x71cf2bd06180
omptarget --> Registered plugin x86_64 with 4 visible device(s)
omptarget --> Image 0x00006440394b60b0 is compatible with RTL x86_64 device 0!
omptarget --> Registering image 0x00006440394b60b0 with RTL x86_64!
omptarget --> Image 0x00006440394b60b0 is compatible with RTL x86_64 device 1!
omptarget --> Registering image 0x00006440394b60b0 with RTL x86_64!
omptarget --> Image 0x00006440394b60b0 is compatible with RTL x86_64 device 2!
omptarget --> Registering image 0x00006440394b60b0 with RTL x86_64!
omptarget --> Image 0x00006440394b60b0 is compatible with RTL x86_64 device 3!
omptarget --> Registering image 0x00006440394b60b0 with RTL x86_64!
omptarget --> Done registering entries!
omptarget --> Entering target region for device -1 with entry point 0x00006440394b6004
omptarget --> Default TARGET OFFLOAD policy is now mandatory (devices were found)
omptarget --> Use default device id 0
omptarget --> Call to omp_get_num_devices returning 4
omptarget --> Call to omp_get_num_devices returning 4
omptarget --> Call to omp_get_initial_device returning 4
omptarget --> Trans table 0x6440394bb030 : 0x6440394bb068
PluginInterface --> Load data from image 0x00006440394b60b0
PluginInterface --> Failed to read kernel environment for '__omp_offloading_25_29cb68_main_l3': Failed to find global symbol '__omp_offloading_25_29cb68_main_l3_kernel_environment' in the ELF image
Using default SPMD (2) execution mode
omptarget --> Entry point 0x00006440394b6004 maps to __omp_offloading_25_29cb68_main_l3 (0x000064404d3cb3d0)
omptarget --> loop trip count is 0.
omptarget --> Launching target execution __omp_offloading_25_29cb68_main_l3 with pointer 0x000064404d3cb3d0 (index=0).
PluginInterface --> Launching kernel __omp_offloading_25_29cb68_main_l3 with [1,1,1] blocks and [0,1,1] threads in Generic mode
Segmentation fault (core dumped)
```
gdb shows crash inside libffi.so. I'm using libffi 3.4.6.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs