------- Comment #23 from jv244 at cam dot ac dot uk 2009-06-10 13:18 ------- (In reply to comment #22) > Thanks for reduced test. > > $ ./a.out >badfile > $ xxd badfile > 0000000: 2020 2020 2020 2020 2020 2020 2020 3320 3 > 0000010: 2020 2020 2020 2020 2020 2020 2020 3300 3. > > The NULL in the last byte should be a space.
I guess this is try as well, in addition there are also the same valgrind warnings about using data from a deallocated buffer: ==24239== Invalid read of size 1 ==24239== at 0x4BE3C4C: formatted_transfer (transfer.c:874) ==24239== by 0x400D21: __m1_MOD_s1 (t.f90:9) ==24239== by 0x400D91: MAIN__ (t.f90:15) ==24239== by 0x400DC9: main (fmain.c:21) ==24239== Address 0x55da8a6 is 6 bytes inside a block of size 640 free'd ==24239== at 0x4A2196E: free (vg_replace_malloc.c:323) ==24239== by 0x400D5E: __m1_MOD_s1 (t.f90:9) ==24239== by 0x400D87: MAIN__ (t.f90:14) ==24239== by 0x400DC9: main (fmain.c:21) ==24239== ==24239== Invalid read of size 1 ==24239== at 0x4BE3C60: formatted_transfer (transfer.c:878) ==24239== by 0x400D21: __m1_MOD_s1 (t.f90:9) ==24239== by 0x400D91: MAIN__ (t.f90:15) ==24239== by 0x400DC9: main (fmain.c:21) ==24239== Address 0x55da8a7 is 7 bytes inside a block of size 640 free'd ==24239== at 0x4A2196E: free (vg_replace_malloc.c:323) ==24239== by 0x400D5E: __m1_MOD_s1 (t.f90:9) ==24239== by 0x400D87: MAIN__ (t.f90:14) ==24239== by 0x400DC9: main (fmain.c:21) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40330