From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by sourceware.org (Postfix) with ESMTPS id 1B9393858C78; Fri, 29 Sep 2023 12:39:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1B9393858C78 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-27752a1e180so7538314a91.1; Fri, 29 Sep 2023 05:39:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695991151; x=1696595951; darn=gcc.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=P5l917ghp+B7i2afQAIsdjgy5NOebNLor5rgAYdCgQo=; b=YLiMKeFQcUDauKv3A+DsSLgSGQT/xaypIfeehzKBqlk0LgaIEHrbI9pfYwne+s4cdA +2rfsdPHchEU+XP0FBUepPoarDfXtJlmiotq/8ZJJlwXqIGdiGQk2Oz0CV01/MH8PCQR HCVkPfYDonzOTvleQoACieFLPYT7ecW2tTd2NjQcSv++Q57TA4Cro33zhXF4m2Ed9CmD dLLAXQJwI67kOSrxgHKNdt0sobLfs/C5gbYlt16V10Wv2TEg3/q4xKRD3JZD9yycYzuN kun76lSqlFsUqzIJRSebakwYPsW31HrL+cRNdQyc3/QHys/PZS58tU6rstxtkuJhX8WQ jq5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695991151; x=1696595951; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=P5l917ghp+B7i2afQAIsdjgy5NOebNLor5rgAYdCgQo=; b=pBxRbYhkMrR1/ZapsWF+IH7tQraxeY0OzKQ4jnjs1UgD58UZGogeGEnji2cbqK5JoX lyJ5bSC1K/c74h5v/OOtlp1kJusjEQSl6ePYEHBJ+bG1qREI+vZ/lrY4nwKXpE11Q0lB Aih2wTGlANl5aTnt3nSl+h1IBZ13VEcrZ49BVR57pYF2j43E15s4CwISCdbYL4RMkcj7 wmizXkO7yzl02+Hlg5rcRaqtyTVoZpSX1Z+BVFcclSFmkpJ13CeQgrxi94m4dABgcjQa J7wHkqhroMnhtrw/87PtQDmtUk8nOmzxEAfqGbReSddOOF7El04LE/GBcRFtAT0iKaQW PCJg== X-Gm-Message-State: AOJu0YzGeUBs4AAmp6+VTgLbRIGEg1KG2P1OjH4dN4PA61hM/cu+v+q4 fJDyO2k4+KP9vZPfLu+S//UGzV4nTN3f1WcaHLQ= X-Google-Smtp-Source: AGHT+IGl0WzflC7Y/D9ivj1jvwJuL+wRre4pZwcIE5PeD9Mb4ZYh9b9YDGmOp2FAbSjvYIA9z2jo2x6aNmNMevGAUfY= X-Received: by 2002:a17:90a:cf01:b0:276:79b6:8bd6 with SMTP id h1-20020a17090acf0100b0027679b68bd6mr3644469pju.15.1695991149433; Fri, 29 Sep 2023 05:39:09 -0700 (PDT) MIME-Version: 1.0 References: <20230928144505.77e03a8e@vepi2> <20230929120118.078188ff@vepi2> In-Reply-To: <20230929120118.078188ff@vepi2> From: Paul Richard Thomas Date: Fri, 29 Sep 2023 13:38:57 +0100 Message-ID: Subject: Re: [Fortran, Patch, Coarray, PR 37336] Fix crash in finalizer when derived type coarray is already freed. To: Andre Vehreschild Cc: GCC-Fortran-ML , GCC-Patches-ML , Katherine Rasmussen , Brad Richardson Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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 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 allocatable derived > > > typed coarray was freed explicitly. The generated cleanup code did not take > > > into account, that the coarray may have been deallocated 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