From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by sourceware.org (Postfix) with ESMTPS id B00BA3865488 for ; Wed, 10 Mar 2021 18:35:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B00BA3865488 X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [127.0.0.1] ([217.224.168.248]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mz9Un-1lgWRU0Rgx-00wHom for ; Wed, 10 Mar 2021 19:35:39 +0100 Date: Wed, 10 Mar 2021 18:34:32 +0000 (UTC) From: mscfd To: fortran@gcc.gnu.org Message-ID: <856aeaf7-defa-4797-a0e2-d4d5e07f5cc6@gmx.net> Subject: MIME-Version: 1.0 X-Correlation-ID: <856aeaf7-defa-4797-a0e2-d4d5e07f5cc6@gmx.net> X-Provags-ID: V03:K1:DVR2ZPBR5PTu0+R7oHiT1Jm715Qzi0uZTY976Uq1K8xdmInxvTr 84aHBR7KQZnCyB+6lOLv/e/G/8Typ+I8w7jveYdIZ8SLYpQDCYHcbVHcxo52E32PDuJ5o+D i5BgzYS6BjWcLbs/EQGOm2eBspsXILahNVpdsLj9mH6D0NRj/kR5bYYkFEGiWWIpuhCpy/U Ef1FK+DR+cZbJ6U6Haz4Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:LZHDKhrZkso=:9Cnbgg9/PIXUMQi6rzyMEz mxbKmxzhfG3AggSlGQW39tDlpnPGCz0ZoA1e1Mt9MDOInAigZ0jjK9C8Vy6BxNkqrFLvFgHc4 4o8p2O8nvgYYlCDeyCWM3TfptWvSW6Kbp0J7EJuOst/4/cVrOsqTm4rVdXpITkvma1cEmZlln Pxkr6kMimWYtceFPo1tylOVs8SqBTlsa4woEEPCwqYE4lsOan5PZ0y4DVA1dG1zTA4GNhGYq2 C0+uHyIJpcQmAaWU/qM4vXgvWAYruCL19dvyuzE1Oesu4V320eHx3eol0kBItfWBA/0gAcEIK j9bRY1f1+X5fvMNP3L9pq9Fzh7Rp7ad/ODWDt17WtjxXbgthlBkndLT/cpiWInXWIFqN93hc0 FCg1W2GLO2EBmlTLjKW7zycwE7a4sqQ4y8Zp/NTkFHkivRf0laAHROEgErLd3Wa3QXuQfG85M um9MFwflfUyS+yRlT9Fa7AUVJGwN8y+wBW27Qv6Ir5jbDEMLLgmbS8jSRwKtiHqVcKDd7mLEd tUtOUX9g6XALQOsxzEqUY5JSL0i6RjkjvE6vcWzo3Haqay4iG2lbUtKGLKqN7KKRv76Wid399 LtTKiacy8iKUeK10pRkz28cj6RnFuScOqVZHEGO00KpjWc6vcudwm0uebGxUKgpy0Lp0Zo5Ce 5b0vL1etPiAT/OZHHVuYO/U3WKtXzCX7xwvD7+AOMvX7v37aWpLun5Zr0kKnX43apvKXKwJBl f9Ik70Ekr/HyFPDMg1bvYt6l/o4GMWpAG5dAg4nb6dUvYUfYnG91ZAUU2sDzNqCiHOWIJuGYj WU+Ux0L+Q5gl61X/C/K2RhGwQ0tmA7qGYVTSaQqeBa0K8NV0KnIvcNiMzY5gtfJMP3i14Qz1m 0ZEpAq/vDmIUDMtZhUvg== X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Mar 2021 18:35:42 -0000 > which version of gfortran, and which operating system? I have seen this on two different Linux distros on x86 with a recently comp= iled version, but also some time ago with an older gfortran 10 version. Using helgrind on a simple omp do loop with write to a character variable, = I get some possible data races in Libgfortran/io/unit.c. There a newunits a= rray is allocated and possibly reallocated in "newunit_alloc". According to= the lock outputs from helgrind I see that this routine is called even if o= utput into character variable is done. Now "newunit_alloc" uses a lock to a= void having several thread all over the place. But newunit_free also writes= to newunits array. And this routine does not obtain a lock itself (see com= ment in unit.c) So in theory it can happen that newunit_alloc reallocated n= ewunits, and newunit_free writes to it just at this time. As I also use 18 = threads the initial size of 16 does not suffice and reallocation does proba= bly indeed happen. Also acces to newunit_lwi is not protected as well (and complained about by= helgrind). =C2=A0 Could it be that the corresponding write routine in transfer.c which calls = newunit_free does not obtain the necessary lock. I cannot find it (which do= es not count much). =C2=A0 Any thoughts? Martin