This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/17636] New: [Sparc g77] "truncation failed in endfile" error when closing a file appended to.
- From: "eesrjhc at bath dot ac dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Sep 2004 15:36:10 -0000
- Subject: [Bug fortran/17636] New: [Sparc g77] "truncation failed in endfile" error when closing a file appended to.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
$ 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