public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-3464] libgomp/nvptx: Prepare for reverse-offload callback handling, resolve spurious SIGSEGVs
@ 2022-10-24 19:48 Thomas Schwinge
  0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-10-24 19:48 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:205538832b7033699047900cf25928f5920d8b93

commit r13-3464-g205538832b7033699047900cf25928f5920d8b93
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Mon Oct 24 21:11:47 2022 +0200

    libgomp/nvptx: Prepare for reverse-offload callback handling, resolve spurious SIGSEGVs
    
    Per commit r13-3460-g131d18e928a3ea1ab2d3bf61aa92d68a8a254609
    "libgomp/nvptx: Prepare for reverse-offload callback handling",
    I'm seeing a lot of libgomp execution test regressions.  Random
    example, 'libgomp.c-c++-common/error-1.c':
    
        [...]
          GOMP_OFFLOAD_run: kernel main$_omp_fn$0: launch [(teams: 1), 1, 1] [(lanes: 32), (threads: 8), 1]
    
        Thread 1 "a.out" received signal SIGSEGV, Segmentation fault.
        0x00007ffff793b87d in GOMP_OFFLOAD_run (ord=<optimized out>, tgt_fn=<optimized out>, tgt_vars=<optimized out>, args=<optimized out>) at [...]/source-gcc/libgomp/plugin/plugin-nvptx.c:2127
        2127            if (__atomic_load_n (&ptx_dev->rev_data->fn, __ATOMIC_ACQUIRE) != 0)
        (gdb) print ptx_dev
        $1 = (struct ptx_device *) 0x6a55a0
        (gdb) print ptx_dev->rev_data
        $2 = (struct rev_offload *) 0xffffffff00000000
        (gdb) print ptx_dev->rev_data->fn
        Cannot access memory at address 0xffffffff00000000
    
            libgomp/
            * plugin/plugin-nvptx.c (nvptx_open_device): Initialize
            'ptx_dev->rev_data'.

Diff:
---
 libgomp/plugin/plugin-nvptx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libgomp/plugin/plugin-nvptx.c b/libgomp/plugin/plugin-nvptx.c
index ad057edabec..0768fca350b 100644
--- a/libgomp/plugin/plugin-nvptx.c
+++ b/libgomp/plugin/plugin-nvptx.c
@@ -546,6 +546,8 @@ nvptx_open_device (int n)
   ptx_dev->omp_stacks.size = 0;
   pthread_mutex_init (&ptx_dev->omp_stacks.lock, NULL);
 
+  ptx_dev->rev_data = NULL;
+
   return ptx_dev;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-24 19:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-24 19:48 [gcc r13-3464] libgomp/nvptx: Prepare for reverse-offload callback handling, resolve spurious SIGSEGVs Thomas Schwinge

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