Hi!

On the gomp-4_0-branch, when using the ID 257 device (host fallback but
with non-shared memory), I see the libgomp.c/target-1.c test fail in
fn2's GOMP_target_update call:

    libgomp: Trying to update [0x601a80..0x601a84) object that is not mapped

Is this a known issue?  (I have not yet started debugging that, and
figured someone more familiar with the code may perhaps easily be able to
tell what's going wrong.)

    Breakpoint 1, 0x00007ffff7316190 in exit () from 
/lib/x86_64-linux-gnu/libc.so.6
    (gdb) bt
    #0  0x00007ffff7316190 in exit () from /lib/x86_64-linux-gnu/libc.so.6
    #1  0x00007ffff78c703d in gomp_fatal (fmt=fmt@entry=0x7ffff78d1418 "Trying 
to update [%p..%p) object that is not mapped") at [...]/libgomp/error.c:65
    #2  0x00007ffff78cfce6 in gomp_update (devicep=0x602030, 
mapnum=mapnum@entry=2, hostaddrs=hostaddrs@entry=0x7fffffffb370, 
sizes=sizes@entry=0x601a10 <.omp_data_sizes.10.1928>,
        kinds=kinds@entry=0x601a00 <.omp_data_kinds.11.1929> "\022\032") at 
[...]/libgomp/target.c:462
    #3  0x00007ffff78d08ce in GOMP_target_update (device=device@entry=-1, 
openmp_target=openmp_target@entry=0x0, mapnum=mapnum@entry=2, 
hostaddrs=hostaddrs@entry=0x7fffffffb370, sizes=sizes@entry=0x601a10 
<.omp_data_sizes.10.1928>,
        kinds=kinds@entry=0x601a00 <.omp_data_kinds.11.1929> "\022\032") at 
[...]/libgomp/target.c:568
    #4  0x0000000000400f55 in fn2 (x=<optimized out>, x@entry=128, y=<optimized 
out>, y@entry=4, z=<optimized out>, z@entry=6) at 
[...]/libgomp/testsuite/libgomp.c/target-1.c:44
    #5  0x00000000004011ca in main () at 
[...]/libgomp/testsuite/libgomp.c/target-1.c:79


The libgomp.c++/target-1.C test also fails; have not yet looked whether
it's the same issue.


That aside, I'm using the following patch to enable the ID 257 device
without having the LIBGOMP_PLUGIN_PATH environment variable set; OK for
gomp-4_0-branch?

libgomp: Always set up device 257 if no other device has been found.

        libgomp/
        * target.c (gomp_find_available_plugins): Don't skip device 257
        setup.

diff --git libgomp/target.c libgomp/target.c
index c0730a7..d84a1fa 100644
--- libgomp/target.c
+++ libgomp/target.c
@@ -651,11 +651,11 @@ gomp_find_available_plugins (void)
 
   plugin_path = getenv ("LIBGOMP_PLUGIN_PATH");
   if (!plugin_path)
-    return;
+    goto out;
 
   dir = opendir (plugin_path);
   if (!dir)
-    return;
+    goto out;
 
   while ((ent = readdir (dir)) != NULL)
     {
@@ -675,7 +675,7 @@ gomp_find_available_plugins (void)
        {
          num_devices = 0;
          closedir (dir);
-         return;
+         goto out;
        }
 
       devices[num_devices] = current_device;
@@ -686,6 +686,7 @@ gomp_find_available_plugins (void)
     }
   closedir (dir);
 
+ out:
   /* FIXME: Temporary hack for testing non-shared address spaces on host.
      We create device 257 just to check memory mapping.  */
   if (num_devices == 0)


Grüße,
 Thomas

Attachment: pgpiES20MRoeC.pgp
Description: PGP signature

Reply via email to