[Bug fortran/49466] Memory leak with assignment of extended derived types

2011-06-19 Thread dominiq at lps dot ens.fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49466

Dominique d'Humieres dominiq at lps dot ens.fr changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2011.06.19 15:51:25
 Ever Confirmed|0   |1

--- Comment #3 from Dominique d'Humieres dominiq at lps dot ens.fr 2011-06-19 
15:51:25 UTC ---
I see (with valgrind on x86_64-apple-darwin10) the memory leak for gcc 4.6
(revision 166102) and trunk, but not for gcc 4.5.2 or 4.6 revision 162456.


[Bug fortran/49466] Memory leak with assignment of extended derived types

2011-06-19 Thread townsend at astro dot wisc.edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49466

--- Comment #2 from Rich Townsend townsend at astro dot wisc.edu 2011-06-19 
15:39:28 UTC ---
(In reply to comment #1)
 (In reply to comment #0)
  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).
 
 Sorry, I'm not able to reproduce the memory leak with gfortran version 4.5 and
 valgrind. Could you please tell me which gfortran version you use and how you
 detect the memory leak?

This is 4.7.0 (svn) running on OS X 10.6.7. valgrind output:


==32629== Memcheck, a memory error detector
==32629== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==32629== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info
==32629== Command: ./evolve_aflow
==32629== 
--32629-- ./evolve_aflow:
--32629-- dSYM directory is missing; consider using --dsymutil=yes
==32629== 
==32629== HEAP SUMMARY:
==32629== in use at exit: 4,004,088 bytes in 1,002 blocks
==32629==   total heap usage: 2,019 allocs, 1,017 frees, 8,012,001 bytes
allocated
==32629== 
==32629== 3,996,000 bytes in 999 blocks are definitely lost in loss record 4 of
4
==32629==at 0x10001079F: malloc (vg_replace_malloc.c:236)
==32629==by 0x10C27: MAIN__ (in ./evolve_aflow)
==32629==by 0x10DA2: main (in ./evolve_aflow)
==32629== 
==32629== LEAK SUMMARY:
==32629==definitely lost: 3,996,000 bytes in 999 blocks
==32629==indirectly lost: 0 bytes in 0 blocks
==32629==  possibly lost: 0 bytes in 0 blocks
==32629==still reachable: 8,088 bytes in 3 blocks
==32629== suppressed: 0 bytes in 0 blocks
==32629== Reachable blocks (those to which a pointer was found) are not shown.
==32629== To see them, rerun with: --leak-check=full --show-reachable=yes
==32629== 
==32629== For counts of detected and suppressed errors, rerun with: -v
==32629== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)


[Bug fortran/49466] Memory leak with assignment of extended derived types

2011-06-19 Thread janus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49466

janus at gcc dot gnu.org changed:

   What|Removed |Added

 CC||janus at gcc dot gnu.org

--- Comment #1 from janus at gcc dot gnu.org 2011-06-19 15:27:55 UTC ---
(In reply to comment #0)
 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).

Sorry, I'm not able to reproduce the memory leak with gfortran version 4.5 and
valgrind. Could you please tell me which gfortran version you use and how you
detect the memory leak?