public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "townsend at astro dot wisc.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/49466] New: Memory leak with assignment of extended derived types
Date: Sun, 19 Jun 2011 00:43:00 -0000	[thread overview]
Message-ID: <bug-49466-4@http.gcc.gnu.org/bugzilla/> (raw)

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49466

           Summary: Memory leak with assignment of extended derived types
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: townsend@astro.wisc.edu


Created attachment 24558
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24558
Sample code reproducing the problem

I've encountered a severe memory leak in one of my codes, which I've been able
to trace back to an issue with the assignment of extended derived types
containing allocatable arrays.

It seems as though any allocatable components of the *parent* type are not
properly deallocated in a variable that appears on the lhs of an assignment
(whether default or defined). 

In the attached sample code, which is a reduced test case from the full code,
the assignment "as_b = as_a" leaks memory from the U(:) allocatable component
(which is defined in state_t, the parent type), but not from the W(:)
allocatable component (which is defined in astate_t).


             reply	other threads:[~2011-06-19  0:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-19  0:43 townsend at astro dot wisc.edu [this message]
2011-06-19 15:28 ` [Bug fortran/49466] " janus at gcc dot gnu.org
2011-06-19 15:40 ` townsend at astro dot wisc.edu
2011-06-19 15:51 ` dominiq at lps dot ens.fr
2011-06-19 17:52 ` [Bug fortran/49466] [4.6/4.7 Regression] " janus at gcc dot gnu.org
2011-06-19 18:45 ` dominiq at lps dot ens.fr
2011-06-19 18:58 ` townsend at astro dot wisc.edu
2011-06-20  6:21 ` dominiq at lps dot ens.fr
2011-06-27 17:33 ` janus at gcc dot gnu.org
2011-06-27 20:59 ` janus at gcc dot gnu.org
2011-07-02 13:46 ` janus at gcc dot gnu.org
2011-07-02 13:52 ` janus 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-49466-4@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).