Observed issues › fuzz/b4-86-cce19
Appears to behave incorrectlyCrashes or aborts at run time · Fortran · OpenMP · Fixed in 21.0.3
ftn 19 and 20: target teams distribute with map(mapper(...)) of a use-associated declare mapper aborts (SIGABRT)
Legality: independently confirmed. 2 independent readings find the program legal and the result required. How this is checked
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 | correct | correct | unknown not run | correct | correct | n/a | n/a |
| CCE 19.0.0 | behaves incorrectly | behaves incorrectly | unknown not run | unknown not run | unknown not run | n/a | n/a |
| CCE 20.0.2 | behaves incorrectly | behaves incorrectly | unknown not run | unknown not run | unknown not run | n/a | n/a |
| CCE 21.0.3 | correct | correct | unknown not run | unknown not run | unknown not run | n/a | n/a |
| CCE 21.0.4 | correct | correct | 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 | fails another way | fails another way |
| NVHPC 26.9 | n/a | n/a | n/a | n/a | n/a | fails another way | fails another way |
| GCC 16.2.0 | fails another way | fails another way | fails another way | fails another way | fails another way | fails another way | 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 | CCE 19.0.0, MI300A unified | showMemory access fault by GPU node-5 (Agent handle: 0x4c78e0) on address (nil). Reason: Write access to a read-only page. |
| behaves incorrectly | CCE 19.0.0, MI300A copy | showMemory access fault by GPU node-4 (Agent handle: 0x4c78e0) on address (nil). Reason: Unknown. |
| behaves incorrectly | CCE 20.0.2, MI300A unified | showMemory access fault by GPU node-5 (Agent handle: 0x4c7dd0) on address (nil). Reason: Write access to a read-only page. |
| behaves incorrectly | CCE 20.0.2, MI300A copy | showMemory access fault by GPU node-7 (Agent handle: 0x4c7dd0) on address (nil). Reason: Unknown. |
| fails another way | NVHPC 25.11, A100 separate NVHPC 25.11, A100 managed NVHPC 26.9, A100 separate NVHPC 26.9, A100 managed | showNVFORTRAN-W-0287-Unrecognized OpenMP directive - declare (fuzz-b4-86-cce19.f90: 14) 0 inform, 1 warnings, 0 severes, 0 fatal for fuzz_dmod NVFORTRAN-S-0034-Syntax error at or near : (fuzz-b4-86-cce19.f90: 38) 0 inform, 0 warnings, 1 severes, 0 fatal for fuzz_prog |
| fails another way | GCC 16.2.0, MI300A unified GCC 16.2.0, MI300A copy GCC 16.2.0, MI250X GCC 16.2.0, MI300X GCC 16.2.0, MI350X GCC 16.2.0, A100 separate | showfuzz-b4-86-cce19.f90:14:9:
14 | !$omp declare mapper(mmap: mt_t :: v) map(tofrom: v%a)
| 1
Error: Unclassifiable OpenMP directive at (1)
fuzz-b4-86-cce19.f90:18:7:
18 | use fuzz_dmod
| 1
Fatal Error: Cannot open module file ‘fuzz_dmod.mod’ for reading at (1): No such file or directory |
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
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 (68 lines)
! Minimized by compliance.fuzz_min from fuzz seed 86 (fuzz-3).
! toolchain: cce19 (-O2, HSA_XNACK=1, OMP_TARGET_OFFLOAD=mandatory)
! failure: run_error (crash: SIGABRT)
! expected: runs to completion (the host run does)
! observed: device: fail crash: SIGABRT; 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: cce20
module fuzz_dmod
implicit none
integer, parameter :: nm = 16
integer, private :: kk
type :: gp_t
end type gp_t
type :: mt_t
integer :: a(nm)
end type mt_t
type :: pair_t
end type pair_t
integer :: gtab(nm) = [(mod(kk * 27 + 46, 1009) - 350, kk = 1, nm)]
type(gp_t) :: gs
!$omp declare mapper(mmap: mt_t :: v) map(tofrom: v%a)
contains
end module fuzz_dmod
module fuzz_dfun
use fuzz_dmod
implicit none
contains
end module fuzz_dfun
module fuzz_mod
implicit none
contains
end module fuzz_mod
program fuzz_prog
use omp_lib, only: omp_is_initial_device
use fuzz_dmod
implicit none
integer, parameter :: n = 16, m = 8
type(mt_t) :: ms
integer :: i, j, hf2
integer(8) :: cs
do i = 1, n
ms%a(i) = mod(i * 5 + 23, 101) - 50
end do
hf2 = 0
! fuzz: kernels
!$omp target teams map(mapper(mmap), tofrom: ms) map(tofrom: hf2)
!$omp distribute
do i = 1, n
if (i == 1) hf2 = merge(1, 0, omp_is_initial_device())
end do
!$omp end target teams
! fuzz: checksum
cs = 0
print '(a,i0,a,i0)', 'RESULT checksum=', cs, ' ran_on_host=', max(hf2, 0)
end program fuzz_prog
! spec (requirement): a user-defined mapper declared with declare mapper is visible where a variable declared at the same place
! would be, and a map clause with a mapper modifier replaces the mapping of the list item by the map clauses of the mapper.
! "The type and an optional mapper-identifier uniquely identify the mapper for use in a map clause or motion clause later in the
! program. The visibility and accessibility of this declaration are the same as those of a variable declared at the same
! location in the program." (5.2 §5.8.8 p.163 l.8-10)
! "The effect that a user-defined mapper has on either a map clause that maps a list item of the given base language type or a
! motion clause that invokes the mapper and updates a list item of the given base language type is to replace the map or update
! with a set of map clauses or updates derived from the map clauses specified by the mapper, as described in Section 5.8.3 and
! Section 5.9." (5.2 §5.8.8 p.163 l.14-17)
! spec (this program): declare mapper(mmap: mt_t :: v) map(tofrom: v%a) in a module, used by use association in target teams
! map(mapper(mmap), tofrom: ms) with a distribute loop, is legal; CCE 19 and 20 abort at run time (SIGABRT).
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
Memory access fault by GPU node-5 (Agent handle: 0x4c78e0) on address (nil). Reason: Write access to a read-only page.
What the specification requires
The specification text this program relies on and the compiler is expected to support.
OpenMP 5.2 §5.8.8 p.163 l.8-10
The type and an optional mapper-identifier uniquely identify the mapper for use in a map clause or motion clause later in the program. The visibility and accessibility of this declaration are the same as those of a variable declared at the same location in the program.
OpenMP 5.2 §5.8.8 p.163 l.14-17
The effect that a user-defined mapper has on either a map clause that maps a list item of the given base language type or a motion clause that invokes the mapper and updates a list item of the given base language type is to replace the map or update with a set of map clauses or updates derived from the map clauses specified by the mapper, as described in Section 5.8.3 and Section 5.9.
Evidence
Other compilers run it correctly
AFAR 24.3.0