PR38319 - Memory leaks in allocatable component expressions

Paul Richard Thomas paul.richard.thomas@gmail.com
Sun Jan 31 15:17:00 GMT 2010


Dear All,

Having turned at last to this PR, I am now unable to find any runtime
memory leaks using valgrind.  The testcases that were supposed to leak
were:

alloc_comp_assign_2.f90      FOR_ALL problem(lines 27, 28 and 47)
alloc_comp_assign_4.f90      nested constructors(line 56)
alloc_comp_basics_2.f90      repeated ALLOCATE (lines 29, 30 and 35)
alloc_comp_basics_5.f90      repeated ALLOCATE (lines 29, 30 and 35)
alloc_comp_constructor_2.f90 nested constructors(line 23)
alloc_comp_initializer_1.f90 nested constructors(line 43)

All of the above show:
....snip....
==12344== Conditional jump or move depends on uninitialised value(s)
==12344==    at 0x43FDF3: __linkin_atfork (in /home/pault/prs/pr38324/a.out)
==12344==    by 0x433682: ptmalloc_init (in /home/pault/prs/pr38324/a.out)
==12344==    by 0x436F93: malloc_hook_ini (in /home/pault/prs/pr38324/a.out)
==12344==    by 0x4688D1: _dl_init_paths (in /home/pault/prs/pr38324/a.out)
==12344==    by 0x44094E: _dl_non_dynamic_init (in
/home/pault/prs/pr38324/a.out)
==12344==    by 0x44120A: __libc_init_first (in /home/pault/prs/pr38324/a.out)
==12344==    by 0x417F02: (below main) (in /home/pault/prs/pr38324/a.out)
==12344==
==12344== Use of uninitialised value of size 8
==12344==    at 0x41DF9B: exit (in /home/pault/prs/pr38324/a.out)
==12344==    by 0x41842F: (within /home/pault/prs/pr38324/a.out)
==12344==    by 0x417F88: (below main) (in /home/pault/prs/pr38324/a.out)
==12344==
==12344== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
==12344== malloc/free: in use at exit: 0 bytes in 0 blocks.
==12344== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
==12344== For counts of detected errors, rerun with: -v
==12344== All heap blocks were freed -- no leaks are possible.

I wonder if the conditional jump depending on an uninitialised value
is connected with the disappearance of the memory leaks?

Anyway, I would be grateful if somebody would check for these memory
leaks because they are a tad difficult to fix right now.

Cheers

Paul



More information about the Fortran mailing list