------- Comment #1 from dfranke at gcc dot gnu dot org  2007-06-29 21:00 -------
Bill, thanks for your report! Here's a slightly simplified testcase:

$> cat pr32550.f90
integer, pointer, save :: ptr
integer, target :: targ
!$omp threadprivate(ptr)
!$omp parallel shared(targ)
!$omp single
ptr => targ
!$omp end single copyprivate(ptr)
!$omp end parallel
END

The testcase compiles, but crashes on execution (SIGSEGV). If the
COPYPRIVATE-clause or the pointer/target attributes are removed, the resulting
binary does not crash. 

Output from gdb is not very helpful, but valgrind gives:

==32677== Thread 2:
==32677== Invalid write of size 4
==32677==    at 0x80486FE: MAIN__.omp_fn.0 (pr32550.f90:9)
==32677==    by 0x40FAFFC: gomp_thread_start (team.c:108)
==32677==    by 0x410F2C0: start_thread (in /lib/libpthread-2.5.so)
==32677==    by 0x41D8FAD: clone (in /lib/libc-2.5.so)
==32677==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==32677==
==32677== Process terminating with default action of signal 11 (SIGSEGV)
==32677==  Access not within mapped region at address 0x0
==32677==    at 0x80486FE: MAIN__.omp_fn.0 (pr32550.f90:9)
==32677==    by 0x40FAFFC: gomp_thread_start (team.c:108)
==32677==    by 0x410F2C0: start_thread (in /lib/libpthread-2.5.so)
==32677==    by 0x41D8FAD: clone (in /lib/libc-2.5.so)

Adding Jakub as CC.


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dfranke at gcc dot gnu dot
                   |                            |org, jakub at gcc dot gnu
                   |                            |dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
  GCC build triplet|x86_64-suse-linux           |
   GCC host triplet|x86_64-suse-linux           |
 GCC target triplet|x86_64-suse-linux           |
           Keywords|                            |openmp
      Known to fail|                            |4.2.1 4.3.0
   Last reconfirmed|0000-00-00 00:00:00         |2007-06-29 21:00:42
               date|                            |
            Summary|THE COPYPRIVATE CLAUSE FAILS|openmp: COPYPRIVATE of
                   |TO COPY THE PTR AT THE END  |pointer variables fails
                   |OF A 'SINGLE' CONSTRUCT     |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32550

Reply via email to