public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/49466] New: Memory leak with assignment of extended derived types
@ 2011-06-19  0:43 townsend at astro dot wisc.edu
  2011-06-19 15:28 ` [Bug fortran/49466] " janus at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: townsend at astro dot wisc.edu @ 2011-06-19  0:43 UTC (permalink / raw)
  To: gcc-bugs

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).


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-07-02 13:52 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-19  0:43 [Bug fortran/49466] New: Memory leak with assignment of extended derived types townsend at astro dot wisc.edu
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

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).