OffTarget

Observed issues › fuzz/s1-7882-cce20

Appears to behave incorrectlyRun-time error · Fortran · OpenMP · Open

ftn: map(present, tofrom: xc) of an allocatable character array mapped by the enclosing target data stops with "Variable not found in present table"

Legality: independently confirmed. 2 independent readings find the program legal and the result required. How this is checked

Affected variants

CompilerMI300A 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.0correctcorrectcorrectcorrectcorrectn/an/a
CCE 19.0.0behaves incorrectlybehaves incorrectlybehaves incorrectlyunknown
not run
unknown
not run
n/an/a
CCE 20.0.2behaves incorrectlybehaves incorrectlybehaves incorrectlyunknown
not run
unknown
not run
n/an/a
CCE 21.0.3behaves incorrectlybehaves incorrectlybehaves incorrectlyunknown
not run
unknown
not run
n/an/a
CCE 21.0.4behaves incorrectlybehaves incorrectlybehaves incorrectlyunknown
not run
unknown
not run
n/an/a
NVHPC 25.11n/an/an/an/an/afails another wayfails another way
NVHPC 26.9n/an/an/an/an/afails another wayfails another way
GCC 16.2.0correctcorrectcorrectcorrectcorrectcorrectn/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

ResultCompiler and GPUMessage
behaves incorrectlyCCE 19.0.0, MI300A unified
CCE 19.0.0, MI300A copy
CCE 19.0.0, MI250X
show
ACC:            find_in_present_table failed for 'xc(:)' (0x489ec0-0x489f80) from s1-7882-cce20.f90:13
ACC: libcrayacc/acc_runtime.c:703 CRAY_ACC_ERROR - Variable not found in present table
behaves incorrectlyCCE 20.0.2, MI300A unified
CCE 20.0.2, MI300A copy
CCE 20.0.2, MI250X
show
ACC:            find_in_present_table failed for 'xc(:)' (0x48a080-0x48a140) from s1-7882-cce20.f90:13
ACC: libcrayacc/acc_runtime.c:817 CRAY_ACC_ERROR - Variable not found in present table
behaves incorrectlyCCE 21.0.3, MI300A unified
CCE 21.0.3, MI300A copy
CCE 21.0.3, MI250X
CCE 21.0.4, MI300A unified
CCE 21.0.4, MI300A copy
CCE 21.0.4, MI250X
show
ACC:            find_in_present_table failed for 'xc(:)' (0x491080-0x491140) from s1-7882-cce20.f90:13
ACC: libcrayacc/acc_runtime.c:856 CRAY_ACC_ERROR - Variable not found in present table
fails another wayNVHPC 25.11, A100 separate
NVHPC 25.11, A100 managed
NVHPC 26.9, A100 separate
NVHPC 26.9, A100 managed
show
NVFORTRAN-S-0034-Syntax error at or near : (s1-7882-cce20.f90: 13)
  0 inform,   0 warnings,   1 severes, 0 fatal for p

Reproduce

CCE 19.0.0, MI300A unified

module load cce/19.0.0 craype-accel-amd-gfx942 rocm/6.4.3
module unload cray-mpich
ftn -fopenmp -O2 repro.f90 -o repro
HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro

CCE 20.0.2, MI300A unified

module load cce/20.0.2 craype-accel-amd-gfx942 rocm/6.4.3
module unload cray-mpich
ftn -fopenmp -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

AFAR 24.3.0, MI300A unified (runs correctly)

$AFAR/bin/amdflang -fopenmp --offload-arch=gfx942 -O2 repro.f90 -o repro
HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro
Program (58 lines)
! Minimized by compliance.fuzz_min from fuzz seed 7882 (fuzz-3).
! toolchain: cce20 (-O2, HSA_XNACK=1, OMP_TARGET_OFFLOAD=mandatory)
! failure: run_error (exit_status)
! message: Variable not found in present table
! expected: runs to completion (the host run does)
! observed: device: fail exit_status: 1; host reference (afar) 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: cce19, cce21
! Finding: CCE 19, 20, 21 end with exit status 1 ("Variable not
! found in present table", the CCE runtime's present check) at a target
! construct with map(present, tofrom: xc) for a character array xc that the
! enclosing target data construct maps (map(to: ... xc ...)); AFAR runs it.
! Legal OpenMP 5.2: the target data construct makes xc present, so the
! present modifier is satisfied (5.2 §5.8.3 p.152 l.25-27: "If a map clause with a
! present map-type-modifier appears on a construct and on entry to the
! region the corresponding list item is not present in the device data
! environment, runtime error termination is performed"); a
! character array is a map list item. Related to s1-8634-cce21.f90 (CCE ICE
! on a character scalar in enter/exit data): another construct and
! symptom (an array, a run-time presence failure).
! Observed (tuolumne, MI300A, -O2, HSA_XNACK=1 and 0, 2026-10-23,
! results/t28_probe/rt/7882-cce20.f90.*.json): CCE 19, 20, 21 exit status 1
! in both modes; AFAR "RESULT checksum=0" (the reference). Reduced from s1
! seed 7882 by tools/campaigns/fuzz.py minimize-one (197 -> 84 lines).
! Shorter form (fix; written by hand from
! the 84-line reduction, which git history keeps): an allocatable
! character(len=4) array alone in target data map(to: xc) and an inner
! target map(present, tofrom: xc) (data/evidence/dataenv_probe/short/c7882_a.f90).
! Observed (tuolumne, MI300A, -O2, 2026-10-23, results/t28_probe/short/
! c7882_a.f90.*.json): CCE 19, 20, 21 exit status 1 ("Variable not found in
! present table") in both modes; AFAR "RESULT check=pass" in both modes.
! With a fixed-size character array (c7882_b) only CCE 19 fails; with
! other items in the target data list (c7882_c, c7882_d) all three fail.
! Expected: "RESULT check=pass".
program p
  use omp_lib, only: omp_is_initial_device
  implicit none
  integer, parameter :: n = 48
  character(len=4), allocatable :: xc(:)
  integer :: i, hf1
  allocate(xc(n))
  do i = 1, n
    xc(i) = achar(65 + mod(i * 33, 26)) // 'b#c'
  end do
  hf1 = -1
  !$omp target data map(to: xc)
    !$omp target map(present, tofrom: xc) map(tofrom: hf1)
      hf1 = merge(1, 0, omp_is_initial_device())
    !$omp end target
  !$omp end target data
  if (hf1 == 0) then
    print '(a)', 'RESULT check=pass'
  else
    print '(a)', 'RESULT check=fail'
  end if
end program p

Source in the repository

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

ACC:            find_in_present_table failed for 'xc(:)' (0x489ec0-0x489f80) from s1-7882-cce20.f90:13
ACC: libcrayacc/acc_runtime.c:703 CRAY_ACC_ERROR - Variable not found in present table

What the specification requires

The specification text this program relies on and the compiler is expected to support.

OpenMP 5.2 §5.8.3 p.152 l.25-27

If a map clause with a present map-type-modifier appears on a construct and on entry to the region the corresponding list item is not present in the device data environment, runtime error termination is performed

Evidence

Same compiler, one change

  • map(tofrom: xc) without the present modifier: AFAR 24.3.0: correct; CCE 19.0.0: correct; CCE 20.0.2: correct; CCE 21.0.3: correct; CCE 21.0.4: correct
    Control program
    program p
      use omp_lib, only: omp_is_initial_device
      implicit none
      integer, parameter :: n = 48
      character(len=4), allocatable :: xc(:)
      integer :: i, hf1
      allocate(xc(n))
      do i = 1, n
        xc(i) = achar(65 + mod(i * 33, 26)) // 'b#c'
      end do
      hf1 = -1
      !$omp target data map(to: xc)
        !$omp target map(tofrom: xc) map(tofrom: hf1)
          hf1 = merge(1, 0, omp_is_initial_device())
        !$omp end target
      !$omp end target data
      if (hf1 == 0) then
        print '(a)', 'RESULT check=pass'
      else
        print '(a)', 'RESULT check=fail'
      end if
    end program p
    

Other compilers run it correctly

AFAR 24.3.0, GCC 16.2.0