This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Invalid free after last statement


Hi list,

looking closer at my program with valgrind, I find some strange
behaviour in our code (which is a state-of-the-art Mixed-Language
large-scale NLP solver), which seems to originate in the gfortran RTL
(but I am not even sure of that)

[snip]
 Successful termination:    Optimal Solution Found.
STOP Last executable statement
==17159== Invalid free() / delete / delete[]
==17159==    at 0x401CDEA: free (vg_replace_malloc.c:323)
==17159==    by 0x42B47BD: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17159==    by 0x42B3F71: __libc_freeres (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17159==    by 0x4019242: _vgnU_freeres (vg_preloaded.c:60)
==17159==    by 0x4236E03: _Exit (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17159==    by 0x83521B8: _gfortrani_sys_exit (error.c:100)
==17159==    by 0x835281A: _gfortran_stop_string (stop.c:59)
==17159==    by 0x804B5DB: MAIN__ (example.F90:267)
==17159==    by 0x8351B68: main (fmain.c:21)
==17159==  Address 0x4183550 is not stack'd, malloc'd or (recently) free'd
==17159==
==17159== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 21 from 1)
==17159== malloc/free: in use at exit: 0 bytes in 0 blocks.
==17159== malloc/free: 11,744 allocs, 11,745 frees, 873,112 bytes allocated.
==17159== For counts of detected errors, rerun with: -v
==17159== All heap blocks were freed -- no leaks are possible.

This is compiled with -ggdb3 (among other flags) using gcc+gfortran
4.3.3 , since 4.4.0 still fails to bootstrap on my 32-bit Debian 4
office machine :-(
By removing the STOP statement responsible for the last output, I can
change this to

[snip]
 Successful termination:    Optimal Solution Found.
==17237== Invalid free() / delete / delete[]
==17237==    at 0x401CDEA: free (vg_replace_malloc.c:323)
==17237==    by 0x42B47BD: (within /lib/tls/i686/cmov/libc-2.3.6.so)
==17237==    by 0x42B3F71: __libc_freeres (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17237==    by 0x4019242: _vgnU_freeres (vg_preloaded.c:60)
==17237==    by 0x4236E03: _Exit (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17237==    by 0x41BDEAF: (below main) (in /lib/tls/i686/cmov/libc-2.3.6.so)
==17237==  Address 0x4183550 is not stack'd, malloc'd or (recently) free'd
==17237==
==17237== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 21 from 1)
==17237== malloc/free: in use at exit: 0 bytes in 0 blocks.
==17237== malloc/free: 11,744 allocs, 11,745 frees, 873,112 bytes allocated.
==17237== For counts of detected errors, rerun with: -v
==17237== All heap blocks were freed -- no leaks are possible.

which is no more meaningful to me...
The debugger does not catch anything, so this is either a valgrind
hiccup (although 3.3.1 and 3.4.1 both report the same), or the
debugger just doesn't catch it.

Any ideas?

Thanks!
Dennis


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]