This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/17636] New: [Sparc g77] "truncation failed in endfile" error when closing a file appended to.


$ uname -a
SunOS gilbert 5.8 Generic_108528-09 sun4u sparc SUNW,Sun-Blade-100
$ /usr/local/gcc-3.4.2/bin/g77 --version
GNU Fortran (GCC) 3.4.2
.
.

gcc was built with:

$ cd tmp/build
$ ../src/gcc-3.4.2/configure --prefix=/usr/local/gcc-3.4.2
--enable-languages=c,c++,f77 && make bootstrap

$ cat readfail.f
      program readfail
      character*30 str
      
      n=0
      open (10,file='READFAIL.IN')
 10   write(*,*)'Reading'
      read (10,'(A)',end=20,err=90)str
      n=n+1
      write(*,*)n
      goto 10
 20   continue
      write(*,*)'Writing'
      write(10,*)n+1
      write(*,*)'Closing'
      close(10)
      write(*,*)'Done'
      stop

 90   write(*,*) 'Error reading'
      stop
      end
$ cat READFAIL.IN 
1
2
$ /usr/local/gcc-3.4.2/bin/g77 -o readfail readfail.f
$ export LD_LIBRARY_PATH=/usr/local/gcc-3.4.2/lib/
$ ./readfail
 Reading
 1
 Reading
 2
 Reading
 Writing
 Closing
endfile: truncation failed in endfile
apparent state: unit 6 (unnamed)
last format: list io
lately writing sequential formatted external IO
Abort

This also happens with -m64 compile flag and using the sparcv9 64-bit libraries. 
The error does not occur on other architectures (at least
x86_64-unknown-linux-gnu and i686-pc-linux-gnu) all built with the same
configuration.

The same error occurs with GCC versions 3.1.1, 3.2.1, 3.2.3, 3.3.1, 3.3.3,
3.4.0, but NOT with 2.95.3.

-- 
           Summary: [Sparc g77] "truncation failed in endfile" error when
                    closing a file appended to.
           Product: gcc
           Version: 3.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: eesrjhc at bath dot ac dot uk
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: sparc-sun-solaris2.8
  GCC host triplet: sparc-sun-solaris2.8
GCC target triplet: sparc-sun-solaris2.8


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]