valgrind find the following errors when running the a.out of all dg-run
programs of the test suite.

(I think even if it turns out to be rather harmless, it should be fixed. I
think there are a couple of Fortran programmers which use valgrind to debug
their own program and noise such this hampers this. Additionally, it makes
gfortran look bad.)

gfortran ./streamio_2.f90

==19950== Conditional jump or move depends on uninitialised value(s)
==19950==    at 0x4ED06AF: finalize_transfer (transfer.c:2698)
==19950==    by 0x4ED0798: _gfortran_st_write_done (transfer.c:2865)
==19950==    by 0x400B75: MAIN__ (in
/projects/tob/gcc/gcc/testsuite/gfortran.dg/a.out)


Same for:
gfortran ./streamio_5.f90
./streamio_10.f90
./streamio_7.f90
./streamio_11.f90
./streamio_12.f90
./streamio_8.f90
./streamio_1.f90
./streamio_9.f90
gfortran -fmax-subrecord-length=16 ./unformatted_subrecord_1.f90
./unf_read_corrupted_1.f90
./advance_6.f90
./streamio_13.f90


./unf_io_convert_3.f90
==23864== Syscall param write(buf) points to uninitialised byte(s)
==23864==    at 0x562BF30: write (in /lib64/libc-2.7.so)
==23864==    by 0x4ED2E10: do_write (unix.c:410)
==23864==    by 0x4ED2EB4: fd_flush (unix.c:460)
==23864==    by 0x4EC4E9C: _gfortran_st_backspace (file_pos.c:246)
==23864==    by 0x400AB5: MAIN__ (in
/projects/tob/gcc/gcc/testsuite/gfortran.dg/a.
==23864==  Address 0x58c58b4 is 156 bytes inside a block of size 8,344 alloc'd
==23864==    at 0x4C2560E: malloc (in
/usr/lib64/valgrind/amd64-linux/vgpreload_mem
check.so)
==23864==    by 0x4E40FA8: _gfortrani_get_mem (memory.c:48)
==23864==    by 0x4ED3329: fd_to_stream (unix.c:1117)
==23864==    by 0x4ECC458: _gfortrani_new_unit (open.c:378)
==23864==    by 0x4ECCB19: _gfortran_st_open (open.c:563)


Same for:
./unf_io_convert_3.f90


-- 
           Summary: finalize_transfer (transfer.c:2698): Depends on
                    uninitialized memory
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34954

Reply via email to