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]

gfortran/mpich2 uninitialized variables on non-root processes


This is probably a mpich2 issue, but here goes. Consider the following trivial program:

program otest
  implicit none

  open (10, file='/etc/passwd')
  close (10)

end program

Compiling and running under valgrind shows no problems. Yet when running with mpich2 and more than one MPI process, all but the first process show uninitialized variables - both at program start with the _dl_init call, and with the open statement.

Gfortran is at version 4.8.1, mpich2 is at version 1.5. Any thoughts before I throw this over the fence to the mpich2 folks?

Walter

wws@w6ws-4:/tmp$ cat otest.f90
program otest
  implicit none

  open (10, file='/etc/passwd')
  close (10)

end program
wws@w6ws-4:/tmp$ gfortran -g otest.f90
wws@w6ws-4:/tmp$ mpirun -np 2 valgrind --track-origins=yes a.out
==25442== Memcheck, a memory error detector
==25442== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==25442== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==25442== Command: a.out
==25442==
==25443== Memcheck, a memory error detector
==25443== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==25443== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==25443== Command: a.out
==25443==
==25443== Conditional jump or move depends on uninitialised value(s)
==25443== at 0x4F13997: ??? (in /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0) ==25443== by 0x4F12EEB: ??? (in /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0) ==25443== by 0x4E4D247: ??? (in /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0)
==25443==    by 0x400F855: call_init.part.0 (dl-init.c:84)
==25443==    by 0x400F90F: _dl_init (dl-init.c:55)
==25443==    by 0x4001669: ??? (in /lib/x86_64-linux-gnu/ld-2.17.so)
==25443==  Uninitialised value was created by a stack allocation
==25443== at 0x4F1394D: ??? (in /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0)
==25443==
==25443== Conditional jump or move depends on uninitialised value(s)
==25443== at 0x4F135C2: ??? (in /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0) ==25443== by 0x4F135CF: ??? (in /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0) ==25443== by 0x4F14770: ??? (in /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0) ==25443== by 0x4F0B445: ??? (in /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0) ==25443== by 0x4F0BD5B: _gfortran_st_open (in /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0)
==25443==    by 0x400774: MAIN__ (otest.f90:4)
==25443==    by 0x4007E2: main (otest.f90:7)
==25443==  Uninitialised value was created by a stack allocation
==25443== at 0x4F13955: ??? (in /usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0)
==25443==
==25442==
==25442== HEAP SUMMARY:
==25442==     in use at exit: 0 bytes in 0 blocks
==25442==   total heap usage: 27 allocs, 27 frees, 21,286 bytes allocated
==25442==
==25442== All heap blocks were freed -- no leaks are possible
==25442==
==25442== For counts of detected and suppressed errors, rerun with: -v
==25442== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)
==25443==
==25443== HEAP SUMMARY:
==25443==     in use at exit: 0 bytes in 0 blocks
==25443==   total heap usage: 27 allocs, 27 frees, 21,286 bytes allocated
==25443==
==25443== All heap blocks were freed -- no leaks are possible
==25443==
==25443== For counts of detected and suppressed errors, rerun with: -v
==25443== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 2 from 2)
wws@w6ws-4:/tmp$


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