From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by sourceware.org (Postfix) with ESMTPS id 33B123858404; Sun, 1 Oct 2023 19:38:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 33B123858404 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-x102c.google.com with SMTP id 98e67ed59e1d1-2777a5e22b5so7661454a91.1; Sun, 01 Oct 2023 12:38:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696189114; x=1696793914; 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=MOmcpQplMbSrdKuYmH/n+6H1eJyw/YWtWfoFeQfvfeg=; b=TJrEekE54YIk664eBbKQtTfUX+B4UweVXyEAunRu6oL8ielM1o1PZxkSquabjjtOBZ eRY4bzaxUuIyfz/1i9KkAaDGpIU2YlNWDXJwpvUNZv7VRt6RPKaJ4kXRw1vKn1dRvKaI zTFDi7D4cIYNQSsEp87g4gY5WCwnJrUa1/kwXvx+0QJsyQ50igzPMwGRPLHGUF6YHWUA W8Yay0O6qy57pVMSnLR7Er5mUW6gN1tP6ilKAfXXs9gxYUgdzPO4VF/9GMGflAVOUHSY 9wU8xTjXjp6DWQ/ANBurGSv1oeY65Vpcn+qdRTbBTc1GdnLZmBlZyfahTwhNtR6XqEFv MnmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696189114; x=1696793914; 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=MOmcpQplMbSrdKuYmH/n+6H1eJyw/YWtWfoFeQfvfeg=; b=LsUrIgFHzZ+c1UcuzAUTDGp6caatBd05PlOKLXZrfZzwb/R90uCLMeQJ8JnQuVDaQ5 wZdTuhfCsQr6NNtiIPyb+Hey4BCW1ZI1CZOCWI/ojt1NYCpPbDTd0zaCZVpMk7vVBvac 37cqS8WXKh/Uo0UEkwlQQt9fPuGVLTnBFAhyjzHbmCOu8kCMxXfNGQblvF25939eXTee bgn1FhEbhB2pwQRke/yODtzaXKYJswrb3JQdzy2hK07iilP7oK2LEGPYO3L8BzLCqGMS tS0S9qiBrgTqaPJYfl9REic3eVDOtzTCrRAaOWsJeSjhAOTgOFt89LpO3FzPK5qmSUKj I6sA== X-Gm-Message-State: AOJu0Yx7ybxleigjx9ChD50JxOMZzwgAPE2ccnj6FBH437ZfrUH3c0oy o/giVDjEAlNpjF0a99JtIBlpCw38KjcONXp8Kak= X-Google-Smtp-Source: AGHT+IG3DlunpO7YfmuUBU9PH+/1SHNSKwh1T9KztCsxBoaHB4ioznkc3FQiWZ4W9LXGA0TIVuKbQ7meo11rXLGegtE= X-Received: by 2002:a17:90b:1194:b0:269:32d2:5ac4 with SMTP id gk20-20020a17090b119400b0026932d25ac4mr9920385pjb.25.1696189114085; Sun, 01 Oct 2023 12:38:34 -0700 (PDT) MIME-Version: 1.0 References: <20230928144505.77e03a8e@vepi2> <20230929120118.078188ff@vepi2> <20230929151356.54e333ab@vepi2> <20230930151638.52bedb9e@vepi2> In-Reply-To: <20230930151638.52bedb9e@vepi2> From: Paul Richard Thomas Date: Sun, 1 Oct 2023 20:38:22 +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: Andre Vehreschild via Fortran , GCC-Patches-ML , Katherine Rasmussen , Brad Richardson , seurer@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.2 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, All is well that ends well! Thanks for working on this. Regards Paul On Sat, 30 Sept 2023 at 14:16, Andre Vehreschild wrote: > > Hi all, > > back porting to gcc-13 unfortunately caused a regression due to > gfc_deallocate_with_status() having a different parameter count. This is fixed > as obvious by 874b895fffd921659b37dc05bc94eea48e9a0157. > > Sorry for breaking gfortran-13. I still don't know why it checkout fine on my > system in the beginning. I must have done something wrong. > > Please accept my apologies and regards, > Andre > > On Fri, 29 Sep 2023 15:13:56 +0200 > Andre Vehreschild via Fortran wrote: > > > 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 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 > > > > > > -- > > Andre Vehreschild * Email: vehre ad gmx dot de > > > -- > Andre Vehreschild * Email: vehre ad gmx dot de