Observed issues › fuzz/b3-45-cce21
Map(to: zopt) of an absent optional dummy in an internal subroutine crashes the run (SIGSEGV)
Legality: not independently confirmed. no independent review yet How this is checked
Same issue as catalog/afar-flang-absent-optional-target-crash; this program is another reproducer of it.
Affected variants
| Compiler | MI300A gfx942 unified memory (XNACK 1) | MI300A gfx942 copy (XNACK 0) | MI250X gfx90a copy (XNACK 0) | MI300X gfx942 copy (XNACK 0) | MI350X gfx950 copy (XNACK 0) | A100 sm_80 separate memory | A100 sm_80 managed memory |
|---|---|---|---|---|---|---|---|
| AFAR 24.3.0 | behaves incorrectly | behaves incorrectly | unknown not run | behaves incorrectly | behaves incorrectly | n/a | n/a |
| CCE 19.0.0 | correct | correct | unknown not run | unknown not run | unknown not run | n/a | n/a |
| CCE 20.0.2 | correct | correct | unknown not run | unknown not run | unknown not run | n/a | n/a |
| CCE 21.0.3 | behaves incorrectly | behaves incorrectly | unknown not run | unknown not run | unknown not run | n/a | n/a |
| CCE 21.0.4 | behaves incorrectly | behaves incorrectly | unknown not run | unknown not run | unknown not run | n/a | n/a |
| NVHPC 25.11 | n/a | n/a | n/a | n/a | n/a | correct | correct |
| NVHPC 26.9 | n/a | n/a | n/a | n/a | n/a | correct | correct |
| GCC 16.2.0 | correct | correct | correct | correct | correct | correct | n/a |
"behaves incorrectly" / "not supported": this issue, confirmed in up to four environments (another build directory, another node, a repeat). "fails another way": a different failure, not counted as this issue. "unknown": not run there, or the runs disagree.
Messages
| Result | Compiler and GPU | Message |
|---|---|---|
| behaves incorrectly | AFAR 24.3.0, MI300A unified AFAR 24.3.0, MI300A copy | showPluginInterface error: Failure to allocate device memory: "out of resources" failed to allocate from memory manager omptarget error: Failed to process data before launching the kernel. omptarget error: Consult https://openmp.llvm.org/design/Runtimes.html for debugging options. omptarget error: Source location information not present. Compile with -g or -gline-tables-only. omptarget fatal error 1: failure of target construct while offloading is mandatory |
| behaves incorrectly | AFAR 24.3.0, MI300X AFAR 24.3.0, MI350X | showPluginInterface error: Failure to allocate device memory: "out of resources" failed to allocate from memory manager omptarget error: Failed to process data before launching the kernel. omptarget error: Consult https://openmp.llvm.org/design/Runtimes.html for debugging options. omptarget error: Source location information not present. Compile with -g or -gline-tables-only. omptarget fatal error 1: failure of target construct while offloading is mandatory timeout: the monitored command dumped core |
| behaves incorrectly | CCE 21.0.3, MI300A unified CCE 21.0.3, MI300A copy CCE 21.0.4, MI300A unified CCE 21.0.4, MI300A copy | showRUN_FAIL |
Reproduce
AFAR 24.3.0, MI300A unified
$AFAR/bin/amdflang -fopenmp --offload-arch=gfx942 -O2 repro.f90 -o repro HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro
CCE 21.0.3, MI300A unified
module load cce/21.0.3 craype-accel-amd-gfx942 rocm/7.2.0 module unload cray-mpich ftn -fopenmp -O2 repro.f90 -o repro HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro
CCE 21.0.4, MI300A unified
module load cce/21.0.4 craype-accel-amd-gfx942 rocm/7.2.0 module unload cray-mpich ftn -fopenmp -O2 repro.f90 -o repro HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro
NVHPC 25.11, A100 separate (runs correctly)
export LD_LIBRARY_PATH=$NVHPC_25_11/compilers/lib nvfortran -mp=gpu -gpu=cc80 -gpu=mem:separate -O2 repro.f90 -o repro OMP_TARGET_OFFLOAD=mandatory ./repro
Program (79 lines)
! Minimized by compliance.fuzz_min from fuzz seed 45 (fuzz-3).
! toolchain: cce21 (-O2, HSA_XNACK=1, OMP_TARGET_OFFLOAD=mandatory)
! failure: run_error (crash: SIGSEGV)
! expected: runs to completion (the host run does)
! observed: device: fail crash: SIGSEGV; host reference (elision) checksum=0
! Legal OpenMP 5.2: offload.engine.prerun.check accepts it (rerun: offload.engine.rules with the
! race rule and the restriction checks, and the AFAR flang front end, not under test here); no
! compiler under test, gfortran or gcc is a legality witness.
! also fails on: afar
program fuzz_prog
use omp_lib, only: omp_is_initial_device
implicit none
integer, parameter :: n = 64, m = 5
type :: rec_t
end type rec_t
type(rec_t) :: dr
integer :: ib(n)
integer, allocatable :: ic(:, :)
integer, pointer :: o1(:)
integer :: o2(n, m)
integer, target :: o1t(n)
integer :: i, j, jj, p2
integer(8) :: cs
allocate(ic(n, m))
o1 => o1t
do i = 1, n
ib(i) = mod(i * 4 + 15, 1009) - 364
end do
do j = 1, m
do i = 1, n
ic(i, j) = mod((i + 8 * j) * 29 + 24, 1009) - 73
end do
end do
o1 = 0
o2 = 0
p2 = 8
! fuzz: kernels
call kp2(ic, o2, dr, p2)
! fuzz: checksum
cs = 0
do i = 1, n
cs = modulo(cs * 31_8 + int(o1t(i), 8), 2147483629_8)
end do
do j = 1, m
do i = 1, n
cs = modulo(cs * 31_8 + int(o2(i, j), 8), 2147483629_8)
end do
end do
print '(a,i0,a,i0)', 'RESULT checksum=', cs, ' ran_on_host=', 0
contains
subroutine kp1(ib, ic, o1, dr, p2, zopt)
integer, intent(in) :: ib(:)
integer, allocatable, intent(in) :: ic(:, :)
integer, pointer, intent(in) :: o1(:)
type(rec_t), intent(inout) :: dr
integer, value :: p2
integer, intent(in), optional :: zopt(:)
integer :: i, j, jj, acc1
end subroutine kp1
subroutine kp2(ic, o2, dr, p2, zopt)
integer, intent(in) :: ic(:, :)
integer, intent(inout) :: o2(:, :)
type(rec_t), intent(inout) :: dr
integer, intent(in), optional :: p2
integer, intent(in), optional :: zopt(:)
integer :: i, j, jj, t2
!$omp target map(to: zopt)
do i = 1, n
!$omp parallel
!$omp do private(t2)
do j = m, 1, -1
t2 = 0
end do
!$omp end do
!$omp end parallel
end do
!$omp end target
end subroutine kp2
end program fuzz_prog
Something to add? Dispute its legality · Report it fixed in a newer release · Report a mistake on this page
Expected and observed
Observed where it behaves incorrectly
PluginInterface error: Failure to allocate device memory: "out of resources" failed to allocate from memory manager omptarget error: Failed to process data before launching the kernel. omptarget error: Consult https://openmp.llvm.org/design/Runtimes.html for debugging options. omptarget error: Source location information not present. Compile with -g or -gline-tables-only. omptarget fatal error 1: failure of target construct while offloading is mandatory
What the specification requires
The specification text this program relies on and the compiler is expected to support.
The same requirement as the issue catalog/afar-flang-absent-optional-target-crash.
OpenMP 5.2 §3.2.1 p.61
Evidence
Other compilers run it correctly
NVHPC 25.11, NVHPC 26.9, GCC 16.2.0