public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/109646] New: OpenACC attach directive fails with "pointer target not mapped for attach"
@ 2023-04-27 10:37 patrick.begou@univ-grenoble-alpes.fr
  2023-04-27 13:18 ` [Bug libgomp/109646] " patrick.begou@univ-grenoble-alpes.fr
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: patrick.begou@univ-grenoble-alpes.fr @ 2023-04-27 10:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109646

            Bug ID: 109646
           Summary: OpenACC attach directive fails with "pointer target
                    not mapped for attach"
           Product: gcc
           Version: 12.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
          Assignee: unassigned at gcc dot gnu.org
          Reporter: patrick.begou@univ-grenoble-alpes.fr
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

Created attachment 54940
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54940&action=edit
Small test case to reproduce the problem

Using GNU Fortran (GCC) 12.2.1 20230302 [OG12] in OpenACC offloading.

the "!$acc enter data attach" directive fails with the message "libgomp:
pointer target not mapped for attach"

A small test-case is provide.
Compilation: gfortran -g -fopenacc tranform.f90 -o transform
Execution:
./transform 
 In add_new_transform for [Premiere]
 In add_new_transform : [Premiere] is the first transform
 In add_new_transform done for [Premiere]
 In add_new_transform for [Seconde]
 In add_new_transform insert [Seconde] after [Premiere]

libgomp: pointer target not mapped for attach


Test runs fine with nvfortran 22.5 (nvfortran -acc -g  tranform.f90 -o
transform)
Test runs fine with Cray Fortran 15.0.1 (ftn -hacc -g  tranform.f90 -o
transform)

Correct poutput is:
 In add_new_transform for [Premiere]
 In add_new_transform : [Premiere] is the first transform
 In add_new_transform done for [Premiere]
 In add_new_transform for [Seconde]
 In add_new_transform insert [Seconde] after [Premiere]
 In add_new_transform done for [Seconde]
 Found  2

Stack size of the call giving the error:

Thread 1 "transform" hit Breakpoint 2, gomp_attach_pointer
(devicep=devicep@entry=0x634120, aq=aq@entry=0x0, 
    mem_map=mem_map@entry=0x634208, n=n@entry=0xb96cc0, attach_to=12150352,
bias=<optimized out>, cbufp=0x0, 
    allow_zero_length_array_sections=false) at
../../../gcc/libgomp/target.c:1012
1012                  gomp_fatal ("pointer target not mapped for attach");
(gdb) where
#0  gomp_attach_pointer (devicep=devicep@entry=0x634120, aq=aq@entry=0x0,
mem_map=mem_map@entry=0x634208, 
    n=n@entry=0xb96cc0, attach_to=12150352, bias=<optimized out>, cbufp=0x0,
allow_zero_length_array_sections=false)
    at ../../../gcc/libgomp/target.c:1012
#1  0x00007ffff736c007 in goacc_enter_data_internal (aq=<optimized out>,
kinds=<optimized out>, sizes=<optimized out>, 
    hostaddrs=0x7fffffffcc70, mapnum=<optimized out>, acc_dev=<optimized out>)
at ../../../gcc/libgomp/oacc-mem.c:1217
#2  goacc_enter_exit_data_internal (flags_m=<optimized out>, mapnum=<optimized
out>, hostaddrs=0x7fffffffcc70, 
    sizes=<optimized out>, kinds=<optimized out>,
data_enter=data_enter@entry=true, async=<optimized out>, 
    num_waits=<optimized out>, ap=<optimized out>) at
../../../gcc/libgomp/oacc-mem.c:1534
#3  0x00007ffff736cc0c in GOACC_enter_data (flags_m=<optimized out>,
mapnum=<optimized out>, 
    hostaddrs=<optimized out>, sizes=<optimized out>, kinds=<optimized out>,
async=<optimized out>, num_waits=0)
    at ../../../gcc/libgomp/oacc-mem.c:1607
#4  0x000000000040148f in transforms_defs_m::add_new_transform
(transform=0x606a20, name=..., 
    new_ptr=<error reading variable: Cannot access memory at address 0x0>,
_name=7) at tranform.f90:87
#5  0x0000000000401698 in MAIN__ () at tranform.f90:138

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-05-08 13:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-27 10:37 [Bug libgomp/109646] New: OpenACC attach directive fails with "pointer target not mapped for attach" patrick.begou@univ-grenoble-alpes.fr
2023-04-27 13:18 ` [Bug libgomp/109646] " patrick.begou@univ-grenoble-alpes.fr
2023-04-28 13:04 ` tschwinge at gcc dot gnu.org
2023-04-29  9:43 ` patrick.begou@univ-grenoble-alpes.fr
2023-05-08 12:37 ` tschwinge at gcc dot gnu.org
2023-05-08 13:50 ` patrick.begou@univ-grenoble-alpes.fr
2023-05-08 13:58 ` burnus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).