public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jv244 at cam dot ac dot uk" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libfortran/40330] [4.4 Regression] incorrect IO
Date: Wed, 03 Jun 2009 16:47:00 -0000	[thread overview]
Message-ID: <20090603164726.15457.qmail@sourceware.org> (raw)
In-Reply-To: <bug-40330-6642@http.gcc.gnu.org/bugzilla/>



------- Comment #5 from jv244 at cam dot ac dot uk  2009-06-03 16:47 -------
OK, now with easy testcase, as you'll notice from the output, the loop is
important:

IMPLICIT NONE
character(len=100) :: fmt1,str1,fmt2,str2
real*8 :: r(3)=0
integer :: i,iunit

fmt1="(T2,A2,"
str1="a"
iunit=6
DO i=1,10
write(iunit,TRIM(fmt1)//"1X,3F20.10)") TRIM(str1),r(1:3)
ENDDO

END


yields with 4.4.1 under valgrind :

> gfortran test.f90 ; valgrind --tool=memcheck ./a.out
  a         0.0000000000        0.0000000000        0.0000000000
==666==
==666== Invalid read of size 1
==666==    at 0x4A22DF9: strncmp (mc_replace_strmem.c:314)
==666==    by 0x4BD83AF: _gfortrani_parse_format (format.c:188)
==666==    by 0x4BE4B4F: data_transfer_init (transfer.c:2106)
==666==    by 0x400C75: MAIN__ (in /data03/vondele/bug/io/a.out)
==666==    by 0x400D89: main (fmain.c:21)
==666==  Address 0x55d9218 is 0 bytes inside a block of size 1,152 free'd
==666==    at 0x4A2196E: free (vg_replace_malloc.c:323)
==666==    by 0x400D31: MAIN__ (in /data03/vondele/bug/io/a.out)
==666==    by 0x400D89: main (fmain.c:21)
==666==
==666== Invalid read of size 1
==666==    at 0x4A22E06: strncmp (mc_replace_strmem.c:314)
==666==    by 0x4BD83AF: _gfortrani_parse_format (format.c:188)
==666==    by 0x4BE4B4F: data_transfer_init (transfer.c:2106)
==666==    by 0x400C75: MAIN__ (in /data03/vondele/bug/io/a.out)
==666==    by 0x400D89: main (fmain.c:21)
==666==  Address 0x55d9218 is 0 bytes inside a block of size 1,152 free'd
==666==    at 0x4A2196E: free (vg_replace_malloc.c:323)
==666==    by 0x400D31: MAIN__ (in /data03/vondele/bug/io/a.out)
==666==    by 0x400D89: main (fmain.c:21)
==666==
==666== Invalid read of size 1
==666==    at 0x4A22E16: strncmp (mc_replace_strmem.c:314)
==666==    by 0x4BD83AF: _gfortrani_parse_format (format.c:188)
==666==    by 0x4BE4B4F: data_transfer_init (transfer.c:2106)
==666==    by 0x400C75: MAIN__ (in /data03/vondele/bug/io/a.out)
==666==    by 0x400D89: main (fmain.c:21)
==666==  Address 0x55d9219 is 1 bytes inside a block of size 1,152 free'd
==666==    at 0x4A2196E: free (vg_replace_malloc.c:323)
==666==    by 0x400D31: MAIN__ (in /data03/vondele/bug/io/a.out)
==666==    by 0x400D89: main (fmain.c:21)
==666==
==666== Invalid read of size 1
==666==    at 0x4A22E25: strncmp (mc_replace_strmem.c:314)
==666==    by 0x4BD83AF: _gfortrani_parse_format (format.c:188)
==666==    by 0x4BE4B4F: data_transfer_init (transfer.c:2106)
==666==    by 0x400C75: MAIN__ (in /data03/vondele/bug/io/a.out)
==666==    by 0x400D89: main (fmain.c:21)
==666==  Address 0x55d9219 is 1 bytes inside a block of size 1,152 free'd
==666==    at 0x4A2196E: free (vg_replace_malloc.c:323)
==666==    by 0x400D31: MAIN__ (in /data03/vondele/bug/io/a.out)
==666==    by 0x400D89: main (fmain.c:21)
  a         0.0000000000        0.0000000000        0.0000000000
  a         0.0000000000        0.0000000000        0.0000000000
  a         0.0000000000        0.0000000000        0.0000000000
  a         0.0000000000        0.0000000000        0.0000000000


-- 


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


  parent reply	other threads:[~2009-06-03 16:47 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-03 15:45 [Bug libfortran/40330] New: " jv244 at cam dot ac dot uk
2009-06-03 15:46 ` [Bug libfortran/40330] " jv244 at cam dot ac dot uk
2009-06-03 15:54 ` dominiq at lps dot ens dot fr
2009-06-03 16:08 ` jv244 at cam dot ac dot uk
2009-06-03 16:32 ` jv244 at cam dot ac dot uk
2009-06-03 16:47 ` jv244 at cam dot ac dot uk [this message]
2009-06-03 16:49 ` jv244 at cam dot ac dot uk
2009-06-03 16:58 ` jv244 at cam dot ac dot uk
2009-06-03 17:39 ` jb at gcc dot gnu dot org
2009-06-03 18:49 ` jb at gcc dot gnu dot org
2009-06-03 19:19 ` jb at gcc dot gnu dot org
2009-06-03 21:07 ` jb at gcc dot gnu dot org
2009-06-04  5:16 ` jv244 at cam dot ac dot uk
2009-06-04  5:37 ` burnus at gcc dot gnu dot org
2009-06-09 20:56 ` jb at gcc dot gnu dot org
2009-06-09 20:58 ` jb at gcc dot gnu dot org
2009-06-09 22:15 ` jv244 at cam dot ac dot uk
2009-06-10  2:18 ` jvdelisle at gcc dot gnu dot org
2009-06-10  3:11 ` jvdelisle at gcc dot gnu dot org
2009-06-10  6:45 ` burnus at gcc dot gnu dot org
2009-06-10  7:22 ` [Bug libfortran/40330] [4.4, 4.5 " jv244 at cam dot ac dot uk
2009-06-10  7:24 ` jv244 at cam dot ac dot uk
2009-06-10  9:26 ` jv244 at cam dot ac dot uk
2009-06-10 12:32 ` jvdelisle at gcc dot gnu dot org
2009-06-10 13:18 ` jv244 at cam dot ac dot uk
2009-06-10 21:18 ` jb at gcc dot gnu dot org
2009-06-11  1:29 ` jvdelisle at gcc dot gnu dot org
2009-06-11  2:25 ` jvdelisle at gcc dot gnu dot org
2009-06-11  7:04 ` jv244 at cam dot ac dot uk
2009-06-11 12:50 ` jvdelisle at gcc dot gnu dot org
2009-06-11 14:58 ` [Bug libfortran/40330] [4.5 " jvdelisle at gcc dot gnu dot org
2009-06-12  5:48 ` jv244 at cam dot ac dot uk
2009-06-26 15:50 ` jvdelisle at gcc dot gnu dot org
2009-07-05  2:12 ` jvdelisle at gcc dot gnu dot org
2009-07-05 12:25 ` jvdelisle at gcc dot gnu dot org
2009-07-09  1:20 ` jvdelisle at gcc dot gnu dot org
2009-07-09  1:55 ` jvdelisle at gcc dot gnu dot org
2009-07-09  1:59 ` jvdelisle at gcc dot gnu dot org
2009-07-12 14:49 ` jv244 at cam dot ac dot uk
2009-07-23 17:52 ` hjl at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090603164726.15457.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).