public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "anlauf at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/110987] [13/14 Regression] Segmentation fault after finalization of a temporary variable
Date: Mon, 05 Feb 2024 17:34:38 +0000	[thread overview]
Message-ID: <bug-110987-4-HMxHAjJcqq@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-110987-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110987

--- Comment #7 from anlauf at gcc dot gnu.org ---
(In reply to John Haiducek from comment #6)
> I encountered what appears to be the same bug under slightly different
> conditions; I've attached the corresponding code (see attachment named
> "Additional test case"). In this code the crash occurs when finalizing an
> object of a type that inherits from a parent type, where the child type has
> no data members of its own.
> 
> There are several workarounds that prevent the segmentation fault in this
> test:
> - Create the object with the default constructor rather than using a custom
> constructor
> - Add a data member to the child type
> - Remove the final routine from the child type

After the patch in comment#3 the testcase in comment#5 runs cleanly under
valgrind for me.

> - gfortran 14.0.1 experimental on Windows (but in this case there are still
> indications of incorrect behavior; no segfault occurred but a print
> statement added to the end of the code did not produce any output)

I added

  print *, kid% name

and it printed

 Name

  parent reply	other threads:[~2024-02-05 17:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-11  9:11 [Bug fortran/110987] New: " chilikin.k at gmail dot com
2023-08-11  9:12 ` [Bug fortran/110987] " chilikin.k at gmail dot com
2023-08-31 18:51 ` chilikin.k at gmail dot com
2023-12-09 13:27 ` chilikin.k at gmail dot com
2024-02-04 20:51 ` anlauf at gcc dot gnu.org
2024-02-05 15:37 ` jhaiduce at gmail dot com
2024-02-05 15:54 ` jhaiduce at gmail dot com
2024-02-05 17:27 ` [Bug fortran/110987] [13/14 Regression] " anlauf at gcc dot gnu.org
2024-02-05 17:34 ` anlauf at gcc dot gnu.org [this message]
2024-03-22 13:40 ` law at gcc dot gnu.org
2024-03-28 15:59 ` pault at gcc dot gnu.org
2024-03-29  7:23 ` cvs-commit at gcc dot gnu.org
2024-04-23  9:47 ` [Bug fortran/110987] [13 " pault at gcc dot gnu.org
2024-05-06  9:47 ` cvs-commit at gcc dot gnu.org
2024-05-06  9:50 ` pault at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-110987-4-HMxHAjJcqq@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).