public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "patrick.begou@univ-grenoble-alpes.fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgomp/109646] New: OpenACC attach directive fails with "pointer target not mapped for attach"
Date: Thu, 27 Apr 2023 10:37:58 +0000	[thread overview]
Message-ID: <bug-109646-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             reply	other threads:[~2023-04-27 10:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-27 10:37 patrick.begou@univ-grenoble-alpes.fr [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-109646-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).