This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/81222] New: OpenMP 4.5 array reduction clause causes the program to crash


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

            Bug ID: 81222
           Summary: OpenMP 4.5 array reduction clause causes the program
                    to crash
           Product: gcc
           Version: 6.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marcin.marcin.m at gmail dot com
  Target Milestone: ---

I have a feeling I've just found a bug in GCC 6.3.0 OpenMP implementation (new
OpenMP 4.5 features)

I'm running this code: https://gitlab.com/marmistrz/pw-brandes

The parallelization is done by the following OpenMP directive:

    #pragma omp parallel for reduction(+: results[:n])

Where results is obtained as here:
https://gitlab.com/marmistrz/pw-brandes/blob/master/brandes.cpp#L21

I get a segmentation fault when using the following datasets:
http://snap.stanford.edu/data/com-LiveJournal.html
http://snap.stanford.edu/data/web-Stanford.html
(all comment lines (starting with a #) should be removed prior to launching the
computation, otherwise there'll be a parsing error)

The segmentation fault appears only on an Intel Xeon E5-2697 v3 (Haswell)
processor, with 2 or more threads
I have managed to successfully complete the web-Stanford testcase on an Intel
i5-5200U processor, with 4 threads.

The backtrace points to gomp_thread_start:

#0  0x0000000000407006 in brandes () at /home/marmistrz/brandes/brandes.cpp:21
#1  0x00002aaaab31fc56 in gomp_thread_start () at
../../../gcc-6.3.0/libgomp/team.c:119
#2  0x00002aaaab753aa1 in start_thread () from /lib64/libpthread.so.0
#3  0x00002aaaaba51bcd in clone () from /lib64/libc.so.6

It appears that the segfault appears at the very beginning of the thread start.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]