public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/25139]  New: Fortran runtime error: Invalid argument
@ 2005-11-28 16:52 dir at lanl dot gov
  2005-11-29  2:16 ` [Bug libfortran/25139] " jvdelisle at gcc dot gnu dot org
                   ` (36 more replies)
  0 siblings, 37 replies; 38+ messages in thread
From: dir at lanl dot gov @ 2005-11-28 16:52 UTC (permalink / raw)
  To: gcc-bugs

I have been getting this error on one of my programs that does extremely
complex I/O operations for a few months now, but I have been unable to isolate
it. I finally got the same error message from a program that generates random
I/O patterns. About half of the FORTRANS that I run this program with fail, but
I found four including Lahey Fortran and Compaq Fortran that have no complain.
testio.f is the original program. testio2.f is a program made from the output
of testio.f that duplicates the I/O sequence that failed.

[dranta:~/tests/gfortran-D] dir% gfortran -o testio testio.f
[dranta:~/tests/gfortran-D] dir% testio > out
At line 37 of file testio.f
Fortran runtime error: Invalid argument
[dranta:~/tests/gfortran-D] dir% cat testio.f
      program test
      dimension ia(100)
      i=rand(500)
      do 10 i=1,100
      call doio(ia,100)
   10 continue
      stop
      end
      subroutine doio(ia,n)
      dimension ia(n)
      i=1
   10 continue
      ia(i)=1+3*rand(0)+.5
      if(i.gt.1)then
          if(ia(i-1).eq.4.and.ia(i).eq.3)goto 10
      endif
      i=i+1
      if(i.le.n)goto 10
      write(6,1000)ia
      call dowrite(ia,n)
      return
 1000 format(20i4)
      end
      subroutine dowrite(ia,n)
      dimension ia(n)
      dimension data(500)
      nend=1000
      open(unit=11,status='scratch',form='unformatted')
      do 100 i=1,n
      goto (10,20,30,40),ia(i)
  10  continue
      write(6,*)'      rewind 11'
      rewind 11
      goto 100
  20  continue
      write(6,*)'      backspace 11'
      backspace 11
      goto 100
  30  continue
      write(6,*)'      read(11,end=',nend,')data'
      write(6,1000)nend
      nend=nend+1     
      read(11,end=50)data
      goto 100
  40  continue
      write(6,*)'      write(11)data'
      write(11)data
      goto 100
  50  continue
      write(6,*)'      backspace 11'
      backspace 11
      goto 100
 100  continue
      close(11)
      return
1000  format(' ',i4,'  continue')
      end
[dranta:~/tests/gfortran-D] dir% gfortran -o testio2 testio2.f
[dranta:~/tests/gfortran-D] dir% testio2
At line 72 of file testio2.f
Fortran runtime error: Invalid argument
[dranta:~/tests/gfortran-D] dir% cat testio2.f
      program test
      dimension data(100)
       read(11,end=        1000 )data
 1000  continue
       backspace 11
       backspace 11
       backspace 11
       read(11,end=        1001 )data
 1001  continue
       backspace 11
       rewind 11
       backspace 11
       backspace 11
       backspace 11
       rewind 11
       write(11)data
       backspace 11
       backspace 11
       backspace 11
       backspace 11
       backspace 11
       backspace 11
       rewind 11
       backspace 11
       write(11)data
       write(11)data
       write(11)data
       backspace 11
       read(11,end=        1002 )data
 1002  continue
       backspace 11
       rewind 11
       backspace 11
       read(11,end=        1003 )data
 1003  continue
       write(11)data
       write(11)data
       write(11)data
       rewind 11
       read(11,end=        1004 )data
 1004  continue
       rewind 11
       rewind 11
       read(11,end=        1005 )data
 1005  continue
       backspace 11
       write(11)data
       backspace 11
       rewind 11
       backspace 11
       rewind 11
       read(11,end=        1006 )data
 1006  continue
       rewind 11
       write(11)data
       backspace 11
       read(11,end=        1007 )data
 1007  continue
       read(11,end=        1008 )data
 1008  continue
       backspace 11
       read(11,end=        1009 )data
 1009  continue
       backspace 11
       write(11)data
       backspace 11
       read(11,end=        1010 )data
 1010  continue
       read(11,end=        1011 )data
 1011  continue
       backspace 11
       backspace 11
      stop
      end


-- 
           Summary: Fortran runtime error: Invalid argument
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dir at lanl dot gov
  GCC host triplet: powerpc-apple-darwin8.3.0


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


^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2006-01-01  5:14 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-28 16:52 [Bug libfortran/25139] New: Fortran runtime error: Invalid argument dir at lanl dot gov
2005-11-29  2:16 ` [Bug libfortran/25139] " jvdelisle at gcc dot gnu dot org
2005-11-29 12:12 ` [Bug libfortran/25139] "Invalid argument" error on I/O fxcoudert at gcc dot gnu dot org
2005-11-29 12:29 ` fxcoudert at gcc dot gnu dot org
2005-11-29 18:37 ` jb at gcc dot gnu dot org
2005-12-10 15:39 ` [Bug libfortran/25139] [4.1/4.2 regression] " fxcoudert at gcc dot gnu dot org
2005-12-10 16:39 ` fxcoudert at gcc dot gnu dot org
2005-12-12 16:38 ` dir at lanl dot gov
2005-12-12 16:50 ` dir at lanl dot gov
2005-12-13 14:39 ` dir at lanl dot gov
2005-12-13 15:21 ` dir at lanl dot gov
2005-12-16 20:35 ` dir at lanl dot gov
2005-12-19  8:12 ` fxcoudert at gcc dot gnu dot org
2005-12-19 18:40 ` mmitchel at gcc dot gnu dot org
2005-12-21 19:36 ` dir at lanl dot gov
2005-12-21 20:21 ` kargl at gcc dot gnu dot org
2005-12-21 21:43 ` dir at lanl dot gov
2005-12-21 22:14 ` fxcoudert at gcc dot gnu dot org
2005-12-22  1:19 ` jvdelisle at gcc dot gnu dot org
2005-12-22  2:08 ` jvdelisle at gcc dot gnu dot org
2005-12-22 14:00 ` dir at lanl dot gov
2005-12-22 14:18 ` dir at lanl dot gov
2005-12-22 14:24 ` fxcoudert at gcc dot gnu dot org
2005-12-22 16:01 ` dir at lanl dot gov
2005-12-22 16:32 ` dir at lanl dot gov
2005-12-22 17:59 ` jvdelisle at gcc dot gnu dot org
2005-12-22 19:23 ` dir at lanl dot gov
2005-12-22 21:14 ` dir at lanl dot gov
2005-12-22 22:49 ` jvdelisle at gcc dot gnu dot org
2005-12-22 23:03 ` jvdelisle at gcc dot gnu dot org
2005-12-23  0:21 ` jvdelisle at gcc dot gnu dot org
2005-12-23 15:14 ` dir at lanl dot gov
2005-12-23 20:21 ` jvdelisle at gcc dot gnu dot org
2005-12-28 20:58 ` jvdelisle at gcc dot gnu dot org
2005-12-28 21:12 ` jvdelisle at gcc dot gnu dot org
2006-01-01  3:49 ` jvdelisle at gcc dot gnu dot org
2006-01-01  3:53 ` jvdelisle at gcc dot gnu dot org
2006-01-01  5:14 ` jvdelisle at gcc dot gnu dot org

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).