From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3977 invoked by alias); 10 Jun 2009 13:18:22 -0000 Received: (qmail 3914 invoked by uid 48); 10 Jun 2009 13:18:11 -0000 Date: Wed, 10 Jun 2009 13:18:00 -0000 Message-ID: <20090610131811.3912.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libfortran/40330] [4.4, 4.5 Regression] incorrect IO In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jv244 at cam dot ac dot uk" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-06/txt/msg00638.txt.bz2 ------- 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