From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9A1EC3858402; Tue, 12 Oct 2021 06:31:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A1EC3858402 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/102698] omp atomic capture Abnormal results after running multiple times Date: Tue, 12 Oct 2021 06:31:48 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: openmp X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status everconfirmed cc cf_reconfirmed_on keywords Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2021 06:31:48 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102698 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 CC| |jakub at gcc dot gnu.org Last reconfirmed| |2021-10-12 Keywords| |openmp --- Comment #1 from Richard Biener --- Confirmed. helgrind says =3D=3D1313=3D=3D ----------------------------------------------------------= ------ =3D=3D1313=3D=3D=20 =3D=3D1313=3D=3D Possible data race during write of size 4 at 0x64DEB90 by = thread #1 =3D=3D1313=3D=3D Locks held: none =3D=3D1313=3D=3D at 0x566182B: gomp_barrier_wait_end (bar.c:40) =3D=3D1313=3D=3D by 0x566182B: gomp_barrier_wait_end (bar.c:35) =3D=3D1313=3D=3D by 0x565FA2D: gomp_simple_barrier_wait (simple-bar.h:60) =3D=3D1313=3D=3D by 0x565FA2D: gomp_team_start (team.c:853) =3D=3D1313=3D=3D by 0x56576BC: GOMP_parallel (parallel.c:169) =3D=3D1313=3D=3D by 0x400938: aaaa_ieor_ (t.f90:57) =3D=3D1313=3D=3D by 0x400A80: MAIN__ (t.f90:26) =3D=3D1313=3D=3D by 0x40102C: main (t.f90:38) =3D=3D1313=3D=3D=20 =3D=3D1313=3D=3D This conflicts with a previous read of size 4 by thread #24 =3D=3D1313=3D=3D Locks held: none =3D=3D1313=3D=3D at 0x566187B: gomp_barrier_wait_start (bar.h:98) =3D=3D1313=3D=3D by 0x566187B: gomp_barrier_wait (bar.c:56) =3D=3D1313=3D=3D by 0x565EFD2: gomp_simple_barrier_wait (simple-bar.h:60) =3D=3D1313=3D=3D by 0x565EFD2: gomp_thread_start (team.c:117) =3D=3D1313=3D=3D by 0x4C36016: ??? (in /usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so) =3D=3D1313=3D=3D by 0x5CEAA19: start_thread (in /lib64/libpthread-2.31.s= o) =3D=3D1313=3D=3D by 0x6002D0E: clone (in /lib64/libc-2.31.so) =3D=3D1313=3D=3D Address 0x64deb90 is 128 bytes inside a block of size 192= alloc'd =3D=3D1313=3D=3D at 0x4C328FF: malloc (in /usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so) =3D=3D1313=3D=3D by 0x5651308: gomp_malloc (alloc.c:38) =3D=3D1313=3D=3D by 0x565F218: gomp_get_thread_pool (pool.h:42) =3D=3D1313=3D=3D by 0x565F218: get_last_team (team.c:150) =3D=3D1313=3D=3D by 0x565F218: gomp_new_team (team.c:169) =3D=3D1313=3D=3D by 0x56576A5: GOMP_parallel (parallel.c:169) =3D=3D1313=3D=3D by 0x400938: aaaa_ieor_ (t.f90:57) =3D=3D1313=3D=3D by 0x400A80: MAIN__ (t.f90:26) =3D=3D1313=3D=3D by 0x40102C: main (t.f90:38) =3D=3D1313=3D=3D Block was alloc'd by thread #1 (and more of those) and then =3D=3D1313=3D=3D ----------------------------------------------------------= ------ =3D=3D1313=3D=3D=20 =3D=3D1313=3D=3D Possible data race during read of size 4 at 0x64DEC94 by t= hread #1 =3D=3D1313=3D=3D Locks held: none =3D=3D1313=3D=3D at 0x5661963: do_spin (wait.h:57) =3D=3D1313=3D=3D by 0x5661963: do_wait (wait.h:66) =3D=3D1313=3D=3D by 0x5661963: gomp_team_barrier_wait_end (bar.c:112) =3D=3D1313=3D=3D by 0x56604A8: gomp_team_end (team.c:937) =3D=3D1313=3D=3D by 0x400938: aaaa_ieor_ (t.f90:57) =3D=3D1313=3D=3D by 0x400A80: MAIN__ (t.f90:26) =3D=3D1313=3D=3D by 0x40102C: main (t.f90:38) =3D=3D1313=3D=3D=20 =3D=3D1313=3D=3D This conflicts with a previous write of size 4 by thread #3 =3D=3D1313=3D=3D Locks held: none =3D=3D1313=3D=3D at 0x5661A25: gomp_team_barrier_wait_end (bar.c:102) =3D=3D1313=3D=3D by 0x565F011: gomp_thread_start (team.c:124) =3D=3D1313=3D=3D by 0x4C36016: ??? (in /usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so) =3D=3D1313=3D=3D by 0x5CEAA19: start_thread (in /lib64/libpthread-2.31.s= o) =3D=3D1313=3D=3D by 0x6002D0E: clone (in /lib64/libc-2.31.so) =3D=3D1313=3D=3D Address 0x64dec94 is 132 bytes inside a block of size 6,5= 28 alloc'd =3D=3D1313=3D=3D at 0x4C328FF: malloc (in /usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so) =3D=3D1313=3D=3D by 0x5651308: gomp_malloc (alloc.c:38) =3D=3D1313=3D=3D by 0x565F077: gomp_new_team (team.c:174) =3D=3D1313=3D=3D by 0x56576A5: GOMP_parallel (parallel.c:169) =3D=3D1313=3D=3D by 0x400938: aaaa_ieor_ (t.f90:57) =3D=3D1313=3D=3D by 0x400A80: MAIN__ (t.f90:26) =3D=3D1313=3D=3D by 0x40102C: main (t.f90:38) =3D=3D1313=3D=3D Block was alloc'd by thread #1 and =3D=3D1313=3D=3D ----------------------------------------------------------= ------ =3D=3D1313=3D=3D=20 =3D=3D1313=3D=3D Possible data race during write of size 8 at 0x1FFEFFF778 = by thread #1 =3D=3D1313=3D=3D Locks held: none =3D=3D1313=3D=3D at 0x4FDD826: _gfortran_reshape_4 (reshape_i4.c:47) =3D=3D1313=3D=3D=20 =3D=3D1313=3D=3D This conflicts with a previous read of size 8 by thread #3 =3D=3D1313=3D=3D Locks held: none =3D=3D1313=3D=3D at 0x4010D7: aaaa_ieor_._omp_fn.0 (t.f90:59) =3D=3D1313=3D=3D by 0x565F005: gomp_thread_start (team.c:123) =3D=3D1313=3D=3D by 0x4C36016: ??? (in /usr/lib64/valgrind/vgpreload_helgrind-amd64-linux.so) =3D=3D1313=3D=3D by 0x5CEAA19: start_thread (in /lib64/libpthread-2.31.s= o) =3D=3D1313=3D=3D by 0x6002D0E: clone (in /lib64/libc-2.31.so) =3D=3D1313=3D=3D Address 0x1ffefff778 is on thread #1's stack so the thing is having data races, either because the GCC OMP runtime is faulty or your expectations.=