valgrind error report for simple Fortran90 file

Martin Reinecke martin@MPA-Garching.MPG.DE
Thu May 4 11:42:00 GMT 2006


When compiling the code below with gfortran (I tried the 4.0 and 4.1 branches
as well as the mainline) and running it under valgrind, some errors are detected:

program test
character(len=80) str1, str2
str1=''
str2=trim(str1)
end program

~/tmp>gfortran bug.f90
~/tmp>valgrind ./a.out
==19069== Memcheck, a memory error detector.
==19069== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==19069== Using LibVEX rev 1575, a library for dynamic binary translation.
==19069== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
==19069== Using valgrind-3.1.1, a dynamic binary instrumentation framework.
==19069== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==19069== For more details, rerun with: -v
==19069==
==19069== Conditional jump or move depends on uninitialised value(s)
==19069==    at 0x401F27E: memmove (mac_replace_strmem.c:486)
==19069==    by 0x406B82B: _gfortran_copy_string (string_intrinsics.c:96)
==19069==    by 0x8048597: MAIN__ (in /afs/mpa/home/martin/tmp/a.out)
==19069==    by 0x80485D2: main (fmain.c:18)
==19069==
==19069== Conditional jump or move depends on uninitialised value(s)
==19069==    at 0x401F2B0: memmove (mac_replace_strmem.c:486)
==19069==    by 0x406B82B: _gfortran_copy_string (string_intrinsics.c:96)
==19069==    by 0x8048597: MAIN__ (in /afs/mpa/home/martin/tmp/a.out)
==19069==    by 0x80485D2: main (fmain.c:18)
==19069==
==19069== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 23 from 1)
==19069== malloc/free: in use at exit: 0 bytes in 0 blocks.
==19069== malloc/free: 6 allocs, 6 frees, 25,200 bytes allocated.
==19069== For counts of detected errors, rerun with: -v
==19069== All heap blocks were freed -- no leaks are possible.

Is this something to worry about?

Cheers,
   Martin



More information about the Fortran mailing list