This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Memory leaks in compiler
- From: Vincent Lefevre <vincent+gcc at vinc17 dot org>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 11 Jan 2008 21:31:35 +0100
- Subject: Re: Memory leaks in compiler
- References: <4787C3C4.5020909@verizon.net>
On 2008-01-11 11:30:12 -0800, Jerry DeLisle wrote:
> With the Fortran test case I am using for PR34722. I did a valgrind
> check with the following command:
>
> valgrind --leak-check=full f951 inquire_12.f90
>
> The possible problem in mpfr has been around a while.
[...]
> I get the following:
>
> ==14240== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 5 from 1)
> ==14240== malloc/free: in use at exit: 310,961 bytes in 1,036 blocks.
> ==14240== malloc/free: 2,207 allocs, 1,171 frees, 1,296,169 bytes allocated.
> ==14240== For counts of detected errors, rerun with: -v
> ==14240== searching for pointers to 1,036 not-freed blocks.
> ==14240== checked 2,346,928 bytes.
> ==14240==
> ==14240== 64 bytes in 2 blocks are possibly lost in loss record 1 of 8
> ==14240== at 0x4A059F6: malloc (vg_replace_malloc.c:149)
> ==14240== by 0xB2F778: __gmp_default_allocate (in /mnt/sdb2/obj43/gcc/f951)
> ==14240== by 0x4C2B62D: mpfr_init2 (init2.c:53)
> ==14240== by 0x4C34424: mpfr_cache (cache.c:57)
> ==14240== by 0x4C18E48: mpfr_log (log.c:133)
> ==14240== by 0x4C2A4D1: mpfr_log10 (log10.c:111)
> ==14240== by 0x40A29F: gfc_arith_init_1 (arith.c:165)
> ==14240== by 0x443BC2: gfc_init_1 (misc.c:259)
> ==14240== by 0x47684D: gfc_init (f95-lang.c:288)
> ==14240== by 0x6D74F4: toplev_main (toplev.c:2128)
> ==14240== by 0x3B7EC1E073: (below main) (in /lib64/libc-2.7.so)
I'd say that this is a "bug" in GCC, that doesn't call mpfr_free_cache()
before exiting. Now, this isn't really necessary in practice since the
memory will be freed anyway.
--
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)