From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DDF25397282A; Wed, 14 Apr 2021 08:41:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DDF25397282A From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug testsuite/100071] Test case libgomp.fortran/alloc-2.F90 fails with invalid memory reference Date: Wed, 14 Apr 2021 08:41:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: testsuite X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: cc 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: Wed, 14 Apr 2021 08:41:11 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100071 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #2 from Jakub Jelinek --- I have and see =3D=3D3196657=3D=3D Invalid write of size 8 =3D=3D3196657=3D=3D at 0x401DAF: MAIN__ (in /home/jakub/src/gcc/obj02/x86_64-pc-linux-gnu/libgomp/testsuite/alloc-2.exe) =3D=3D3196657=3D=3D by 0x40204A: main (in /home/jakub/src/gcc/obj02/x86_64-pc-linux-gnu/libgomp/testsuite/alloc-2.exe) =3D=3D3196657=3D=3D Address 0x4f2a560 is 48 bytes inside a block of size 8= 96 free'd =3D=3D3196657=3D=3D at 0x483A9F5: free (vg_replace_malloc.c:538) =3D=3D3196657=3D=3D by 0x401C20: MAIN__ (in /home/jakub/src/gcc/obj02/x86_64-pc-linux-gnu/libgomp/testsuite/alloc-2.exe) =3D=3D3196657=3D=3D by 0x40204A: main (in /home/jakub/src/gcc/obj02/x86_64-pc-linux-gnu/libgomp/testsuite/alloc-2.exe) =3D=3D3196657=3D=3D Block was alloc'd at =3D=3D3196657=3D=3D at 0x4839809: malloc (vg_replace_malloc.c:307) =3D=3D3196657=3D=3D by 0x4CF6CCC: omp_aligned_alloc.part.0 (in /home/jakub/src/gcc/obj02/x86_64-pc-linux-gnu/libgomp/.libs/libgomp.so.1.0.= 0) =3D=3D3196657=3D=3D by 0x4018E1: MAIN__ (in /home/jakub/src/gcc/obj02/x86_64-pc-linux-gnu/libgomp/testsuite/alloc-2.exe) =3D=3D3196657=3D=3D by 0x40204A: main (in /home/jakub/src/gcc/obj02/x86_64-pc-linux-gnu/libgomp/testsuite/alloc-2.exe) 2021-04-14 Jakub Jelinek PR testsuite/100071 * testsuite/libgomp.fortran/alloc-1.F90: Call c_f_pointer after last cp =3D omp_alloc with cp, p arguments instead of cq, q and call c_f_pointer after last cq =3D omp_alloc with cq, q. --- libgomp/testsuite/libgomp.fortran/alloc-1.F90.jj 2020-07-18 00:05:57.245601544 +0200 +++ libgomp/testsuite/libgomp.fortran/alloc-1.F90 2021-04-14 10:35:19.425186364 +0200 @@ -155,12 +155,13 @@ cp =3D omp_alloc (ONEoFIVE, & & omp_null_allocator) if (mod (transfer (cp, intptr), 32_c_intptr_t) /=3D 0) stop 17 - call c_f_pointer (cq, q, [ONEoFIVE & + call c_f_pointer (cp, p, [ONEoFIVE & & / c_sizeof (i)]) p(1) =3D 5 p(ONEoFIVE / c_sizeof (i)) =3D 6 cq =3D omp_alloc (768_c_size_t, omp_null_allocator) if (mod (transfer (cq, intptr), 128_c_intptr_t) /=3D 0) stop 18 + call c_f_pointer (cq, q, [768 / c_sizeof (i)]) q(1) =3D 7 q(768 / c_sizeof (i)) =3D 8 if (c_associated (omp_alloc (768_c_size_t, omp_null_allocator))) & seems to fix it.=