From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by sourceware.org (Postfix) with ESMTPS id 4BBAD3875430; Fri, 29 Sep 2023 13:14:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4BBAD3875430 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1695993238; x=1696598038; i=vehre@gmx.de; bh=OnidEMSZSaee9e1YXYANBTsb8yIEdo7IsFiTutmlOJo=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=JEqtFhC0NFmr1l1klLtH2Lq/t5ZjCIUSrtS8ugOLITGLG/5gQUPyzqQ3j+p+cm3nHrAiqp6s1jx J5YdHetLZPTQdwJwG8a6zPwofOKtfJYjNZ7zaI9gvxEAJRanIh15bMxQO8tKs+V/aIDJgOkuE4JGz rk1AXray99SnGEGabex4aqf/XqYUjrNTsd+jJ+6Adnkdi+7LLPTV6qmQQDTUpMv7G3KsH/YGAOYwY HULZGDT2Pbc1plL1zb3DAK1cKQCg8OWwcNLg8OVKsfGnvZsznC4E16wI7sCxrNScL0yTCEBFNeE12 I9Phf2+MkJur+ucr+FIHAkVZ3Kd3FeMCzqHw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from vepi2 ([79.194.173.146]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MoO6M-1rRurW00qW-00ojcO; Fri, 29 Sep 2023 15:13:58 +0200 Date: Fri, 29 Sep 2023 15:13:56 +0200 From: Andre Vehreschild To: Paul Richard Thomas Cc: GCC-Fortran-ML , GCC-Patches-ML , Katherine Rasmussen , Brad Richardson Subject: Re: [Fortran, Patch, Coarray, PR 37336] Fix crash in finalizer when derived type coarray is already freed. Message-ID: <20230929151356.54e333ab@vepi2> In-Reply-To: References: <20230928144505.77e03a8e@vepi2> <20230929120118.078188ff@vepi2> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:AWOXwLC0Idfj/rtEcPi3OTiZC9ejUA+Ccd0TzDfhn/edQNp6hUK bwx/JF4HX8TRgWgk+GAAUJkVBpy+t+ZTrDa9hPlXkKAOyqVFDegsahtfI+cGhvR6pKHskLk pHfYJXqGOOomn3+tNad80+31hkmoBWoALvJOJNZlSqthUxofcII+w+8tDRwPvkhaqj2sCe+ tL5IpSaEHzW0k3FiN8GfA== UI-OutboundReport: notjunk:1;M01:P0:Mv+qWvnc4m8=;5I+Vlm/Oln+t9VCg8s+am39L9Am YFgZqw+BkR7FgCtYrpmB9DXdnVax3m5Py96KnxogGg6M/RrascyDH3xkuIKFrV+EOnPV4Vc2p QIyMAC00X3bPRAYgyWDuHudn6SV9ZXae4NBwkLfNXRI8Me2uy4zTDdJ9SyV7E6L8dvXHNKBnW J+pLGoz3/1BVVS/GD4rE8GU5oFH3chYPeB3iiB7q7epJWepER+aLS9DfpJ+ga54kdQpehDu2h oy73w7f4ReYIcKdlnaI3vSTvo7x8FcjejXe7dYdz3wALO4FAnmPHy2E8VYmMz7JMdmWdrtfWa JdBTOX2zRSnPsqU7Tt9obkxy2VN52yOH0dgNPtJhZuSIFfkawiMhv/RITSjor0IFcq4nkZnsP cM99bBbvmh/LrAHab4jrHDfA8oz3G40sVIU56SMi3zjTQ6/BZraxtG/i6PewS0jtp5iGQaQeF 494VXq+kqRVXxduOqkUhcKmoFmozPck24YIoqi1gxqa0aGeORPBx/qs+uOGvgIIlcs2QW8RNj pp43BY6PEMWhLvXwvVLRdgcuNY8KSTW7HunHPF+Cxc2kQhLzO+XJZkHFKu/U8Wkc+akrrGtJA c+XvqkHNZNohSsA2AIqVIz8lHdqS3871Nb8v/fANjUmyyb7eq9vnf95om9ubBPOUgp5iqMfKy pgXi8ylWcw4MP51oaAvBE0l4ZNgpcbCEKYULI0jTafbsbYvddgXxshSa3ite7sTfRKk72EUs0 5gmzygyVxAxIH93PPjMrjsxN+2VD3RbXCM6ODVk4TxvHM06RkhdYCAkd/qLJEYEty4d3JtUY3 TS0bWMWEayPzuU+QqSR8jMNNXHTWTxTajyimWBroZDqTpX3wnRF6YOLOmtlgQ48UBP+QDyVox lf1e+t2z8itVG91y5VrcSTtmaEHOiQS8IxEryLW6R3JLEl4WfRhi/gOkHnKHJIt7+wQ/Zo+3L t6lNZeXazVeo0PprEkfrSDJjtmU= X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Paul, thanks. Commit to trunk as a680274616ec6b26ccfdcee400ed7f54e341d40c and backported to gcc-13 as d9b3269bdccac2db9200303494c4e82f2aeb7bbc Thanks for the fast review. Regards, Andre On Fri, 29 Sep 2023 13:38:57 +0100 Paul Richard Thomas wrote: > Hi Andre, > > Yes indeed - it's fine for trunk and, I would suggest, 13-branch. > > Cheers > > Paul > > On Fri, 29 Sept 2023 at 11:01, Andre Vehreschild wrote: > > > > Hi Paul, > > > > thanks for the quick review. I've added a testcase with a module and a > > finalizer in the derived type. This also is no problem. > > > > Regtests ok on x86_64_linux_gnu/f37. Ok for trunk? > > > > Regards, > > Andre > > > > On Thu, 28 Sep 2023 19:21:12 +0100 > > Paul Richard Thomas wrote: > > > > > Hi Andre, > > > > > > The patch looks fine to me. Since you mention it in the comment, is = it > > > worth declaring the derived type 'foo' in a module and giving it a > > > final routine? > > > > > > Thanks for the patch. > > > > > > Paul > > > > > > On Thu, 28 Sept 2023 at 13:45, Andre Vehreschild via Fortran > > > wrote: > > > > > > > > Hi all, > > > > > > > > attached patch fixes a crash in coarray programs when an allocatab= le > > > > derived typed coarray was freed explicitly. The generated cleanup = code > > > > did not take into account, that the coarray may have been dealloca= ted > > > > already. The patch fixes this by moving the statements accessing > > > > components inside the derived type into the block guard by its > > > > allocated check. > > > > > > > > Regtested ok on f37/x86_64. Ok for master? > > > > > > > > Regards, > > > > Andre > > > > -- > > > > Andre Vehreschild * Email: vehre ad gmx dot de > > > > > > -- > > Andre Vehreschild * Email: vehre ad gmx dot de =2D- Andre Vehreschild * Email: vehre ad gmx dot de