public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mikael at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/106050] ICE in reject_statement, at fortran/parse.cc:2879 since r8-3056-g5bab4c9631c478b7
Date: Mon, 10 Jul 2023 18:15:27 +0000	[thread overview]
Message-ID: <bug-106050-4-0blg2pqWNy@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-106050-4@http.gcc.gnu.org/bugzilla/>

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

Mikael Morin <mikael at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikael at gcc dot gnu.org

--- Comment #5 from Mikael Morin <mikael at gcc dot gnu.org> ---
When matching statement "type t(k)", two symbols are created, one for t and one
for k.
t is in gfc_current_ns and k is in t's f2k_derived namespace.
If the statement is rejected, both t and k need to be freed.
But one should care about ordering, as the release of t frees f2k_derived,
which is k's namespace, so k should be released before t.

I haven't checked that the above actually is the problem here, but it might be.
Possibly walking the symbols in reverse order to release them would fix this.

Regarding the patches posted, if sym->refs < 0 is true, then the memory for sym
has already been released and may be garbage (including sym->refs).  A crash is
as good as anything else at this point IMHO.

  parent reply	other threads:[~2023-07-10 18:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-21 18:53 [Bug fortran/106050] New: ICE in reject_statement, at fortran/parse.cc:2879 gscfq@t-online.de
2022-06-21 20:47 ` [Bug fortran/106050] " kargl at gcc dot gnu.org
2022-06-27  8:48 ` [Bug fortran/106050] ICE in reject_statement, at fortran/parse.cc:2879 since r8-3056-g5bab4c9631c478b7 marxin at gcc dot gnu.org
2023-06-06 19:18 ` kargl at gcc dot gnu.org
2023-07-10 16:20 ` pault at gcc dot gnu.org
2023-07-10 16:29 ` pault at gcc dot gnu.org
2023-07-10 18:15 ` mikael at gcc dot gnu.org [this message]
2023-07-11 11:24 ` mikael at gcc dot gnu.org
2023-07-11 11:43 ` pault at gcc dot gnu.org
2023-07-13 19:24 ` cvs-commit at gcc dot gnu.org
2023-09-12  8:36 ` mikael at gcc dot gnu.org
2023-09-15 17:24 ` mikael 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-106050-4-0blg2pqWNy@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).