Bug 1832 - -list directed i/o overflow hangs, -fbounds-check doesn't detect
Summary: -list directed i/o overflow hangs, -fbounds-check doesn't detect
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 2.95.3
: P3 normal
Target Milestone: ---
Assignee: Toon Moene
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-02-01 10:26 UTC by robert.c.haskell
Modified: 2003-09-23 22:14 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description robert.c.haskell 2001-02-01 10:26:01 UTC
The following program has a coding mistake - internal i/o overflow in
the write statement.  This program will generate a runtime error message
when compiled with the HP-UX and AIX fortran compilers.  When compiled
using g77, program execution will hang at the write statement. 
Compiling with the -fbounds-check has no effect.  If the format is
changed to "(2a)", then the program will run without any messages.  But
it ought to generate a runtime error about the overflow, at least when
compiled with -fbounds-check.

Release:
g77 version 2.95.3 19991030 (prerelease)

Environment:
(from FSF-g77 version 0.5.25 19991030 (prerelease))
Driving: g77 -v t.f -o t -lg2c -lm
Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux/2.95.3/specs
gcc version 2.95.3 19991030 (prerelease)
 /usr/lib/gcc-lib/i586-mandrake-linux/2.95.3/f771 t.f -quiet -dumpbase
t.f -version -fversion -o /tmp/ccHM9EZy.s
GNU F77 version 2.95.3 19991030 (prerelease) (i586-mandrake-linux)
compiled by GNU C version 2.95.3 19991030 (prerelease).
GNU Fortran Front End version 0.5.25 19991030 (prerelease)
 as -V -Qy -o /tmp/ccebCcp0.o /tmp/ccHM9EZy.s
GNU assembler version 2.10.90 (i586-mandrake-linux) using BFD version
2.10.0.24
 /usr/lib/gcc-lib/i586-mandrake-linux/2.95.3/collect2 -m elf_i386
-dynamic-linker /lib/ld-linux.so.2 -o t /usr/lib/crt1.o /usr/lib/crti.o
/usr/lib/gcc-lib/i586-mandrake-linux/2.95.3/crtbegin.o
-L/usr/lib/gcc-lib/i586-mandrake-linux/2.95.3
-L/usr/i586-mandrake-linux/lib /tmp/ccebCcp0.o -lg2c -lm -lgcc -lc -lgcc
/usr/lib/gcc-lib/i586-mandrake-linux/2.95.3/crtend.o /usr/lib/crtn.o

How-To-Repeat:
      implicit none

      character*120 file
      character*5 string

      file = "c:/dos/adir/bdir/cdir/text.doc"

      write( string, * ) "a ", file
      print *, string

      stop
      end
Comment 1 robert.c.haskell 2001-02-01 10:26:01 UTC
Fix:
not known
Comment 2 Toon Moene 2001-06-06 12:40:51 UTC
Responsible-Changed-From-To: unassigned->toon
Responsible-Changed-Why: I analyzed it.
Comment 3 Toon Moene 2001-06-06 12:40:51 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: It's a real bug, though no regression (has been wrong
    always).
Comment 4 Toon Moene 2001-06-06 19:40:51 UTC
From: toon@gcc.gnu.org
To: Robert.C.Haskell@rolls-royce.com, gcc-gnats@gcc.gnu.org,
  nobody@gcc.gnu.org, toon@gcc.gnu.org
Cc:  
Subject: Re: fortran/1832
Date: 6 Jun 2001 19:40:51 -0000

 Synopsis: -list directed i/o overflow hangs, -fbounds-check doesn't detect
 
 Responsible-Changed-From-To: unassigned->toon
 Responsible-Changed-By: toon
 Responsible-Changed-When: Wed Jun  6 12:40:51 2001
 Responsible-Changed-Why:
     I analyzed it.
 State-Changed-From-To: open->analyzed
 State-Changed-By: toon
 State-Changed-When: Wed Jun  6 12:40:51 2001
 State-Changed-Why:
     It's a real bug, though no regression (has been wrong
     always).
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=1832&database=gcc
Comment 5 Toon Moene 2003-04-12 11:46:36 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed by Bud Davis for GCC/g77 3.3
    [ Sorry it took so long ]