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

* [Bug libgomp/109646] OpenACC attach directive fails with "pointer target not mapped for attach"
  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 ` patrick.begou@univ-grenoble-alpes.fr
  2023-04-28 13:04 ` tschwinge at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: patrick.begou@univ-grenoble-alpes.fr @ 2023-04-27 13:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Patrick Bégou <patrick.begou@univ-grenoble-alpes.fr> ---
Using 12.2.1 as more recent versions of gfortran cannot compile this file (see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109622)

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

* [Bug libgomp/109646] OpenACC attach directive fails with "pointer target not mapped for attach"
  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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2023-04-28 13:04 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Schwinge <tschwinge at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=109622
             Status|UNCONFIRMED                 |WAITING
                 CC|                            |burnus at gcc dot gnu.org,
                   |                            |jules at gcc dot gnu.org,
                   |                            |tschwinge at gcc dot gnu.org
   Last reconfirmed|                            |2023-04-28

--- Comment #2 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
This sounds as if it may've been fixed (for GCC master branch) via today's
PR109622 "[OpenACC] internal compiler error: in omp_group_base, at
gimplify.cc:9412 if -fopenacc is set" commit
r14-325-gcacf65d74463600815773255e8b82b4043432bd7 "OpenACC: Stand-alone
attach/detach clause fixes for Fortran [PR109622]"?  Please check.

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

* [Bug libgomp/109646] OpenACC attach directive fails with "pointer target not mapped for attach"
  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
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: patrick.begou@univ-grenoble-alpes.fr @ 2023-04-29  9:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Patrick Bégou <patrick.begou@univ-grenoble-alpes.fr> ---
Confirmed that this commit fixes this problem and
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109622 report too.

I will check with the full application soon (need to rebuild OpenMPI for GCC
14).

Many thanks you for your responsiveness.

Patrick

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

* [Bug libgomp/109646] OpenACC attach directive fails with "pointer target not mapped for attach"
  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
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: tschwinge at gcc dot gnu.org @ 2023-05-08 12:37 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Schwinge <tschwinge at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jules at gcc dot gnu.org

--- Comment #4 from Thomas Schwinge <tschwinge at gcc dot gnu.org> ---
Julian, Patrick, do I understand correctly that no further work is necessary
here in addition to what's already been implemented for PR109622 "[OpenACC]
internal compiler error: in omp_group_base, at gimplify.cc:9412 if -fopenacc is
set", and thus this PR109646 is all resolved?

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

* [Bug libgomp/109646] OpenACC attach directive fails with "pointer target not mapped for attach"
  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
                   ` (3 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: patrick.begou@univ-grenoble-alpes.fr @ 2023-05-08 13:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Patrick Bégou <patrick.begou@univ-grenoble-alpes.fr> ---
Hi Thomas,

yes, I cannot reproduce this problem anymore and the full application compiles
now.I think it could be marked solved.
Even if I have a new problem, but at axecution time now. I've posted a new
report last week. Indeed I've only validated the test-case not the full
application as, with this new error, I do not reach this section of code in it.

Thanks
Patrick

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

* [Bug libgomp/109646] OpenACC attach directive fails with "pointer target not mapped for attach"
  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
                   ` (4 preceding siblings ...)
  2023-05-08 13:50 ` patrick.begou@univ-grenoble-alpes.fr
@ 2023-05-08 13:58 ` burnus at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2023-05-08 13:58 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Based on the comment, close as FIXED.

(The commits of PR109622 went into GCC 13 and mainline/GCC 14.)

Thanks for the report! If another issue shows up, please just open a new
problem report!

^ 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).