public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/20257] New: Fortran runtime error: End of record occurs when writing large arrays
@ 2005-03-01 2:50 kamaraju at gmail dot com
2005-03-01 3:14 ` [Bug fortran/20257] " jvdelisle at verizon dot net
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: kamaraju at gmail dot com @ 2005-03-01 2:50 UTC (permalink / raw)
To: gcc-bugs
Consider the following test program (fortran 90)
program explore
implicit none
integer, parameter :: NX = 32, NR = 16, NPHI=2
real :: input(0:NX-1, 0:NR-1, 0:NPHI-1)
write(*,*) size(input)
call random_number(input)
write(*,*) input
end program explore
This program compiles fine. It executes fine. But when the output is redirected
to a file, it produces the following error.
$gfortran explore.f90
$./a.out > temp
At line 11 of file explore.f90
Fortran runtime error: End of record
system & build information:
$gfortran -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f95,objc,ada--prefix=/usr/lib/gcc-snapshot
--enable-shared --with-system-zlib --enable-nls --enable-threads=posix
--without-included-gettext --disable-werror --enable-__cxa_atexit
--enable-libstdcxx-allocator=mt --enable-clocale=gnu
--enable-libstdcxx-debug --enable-mpfr --enable-java-gc=boehm
--enable-java-awt=gtk --enable-gtk-cairo --enable-checking=release
i486-linux-gnu
Thread model: posix
gcc version 4.1.0 20050227 (experimental)
$gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,c++,java,f95,objc,ada
--prefix=/usr/lib/gcc-snapshot --enable-shared --with-system-zlib --enable-nls
--enable-threads=posix --without-included-gettext --disable-werror
--enable-__cxa_atexit --enable-libstdcxx-allocator=mt --enable-clocale=gnu
--enable-libstdcxx-debug --enable-mpfr --enable-java-gc=boehm
--enable-java-awt=gtk --enable-gtk-cairo --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.0 20050227 (experimental)
$uname -a
Linux kusumanchi 2.6.9-1-686 #1 Thu Nov 25 03:48:29 EST 2004 i686 GNU/Linux
Other information:
System is Debian unstable (sid).
--
Summary: Fortran runtime error: End of record occurs when writing
large arrays
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kamaraju at gmail dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20257
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/20257] Fortran runtime error: End of record occurs when writing large arrays
2005-03-01 2:50 [Bug fortran/20257] New: Fortran runtime error: End of record occurs when writing large arrays kamaraju at gmail dot com
@ 2005-03-01 3:14 ` jvdelisle at verizon dot net
2005-03-01 13:10 ` coudert at clipper dot ens dot fr
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jvdelisle at verizon dot net @ 2005-03-01 3:14 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From jvdelisle at verizon dot net 2005-03-01 03:14 -------
I noticed on a the list mention that the error occurs only when the output is
redirected. When I run ./a.out the error message is embedded in the middle of
the output before the last numbers are printed.
The error message gets printed out before the stdout buffer finishes.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20257
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/20257] Fortran runtime error: End of record occurs when writing large arrays
2005-03-01 2:50 [Bug fortran/20257] New: Fortran runtime error: End of record occurs when writing large arrays kamaraju at gmail dot com
2005-03-01 3:14 ` [Bug fortran/20257] " jvdelisle at verizon dot net
@ 2005-03-01 13:10 ` coudert at clipper dot ens dot fr
2005-03-01 13:12 ` coudert at clipper dot ens dot fr
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: coudert at clipper dot ens dot fr @ 2005-03-01 13:10 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From coudert at clipper dot ens dot fr 2005-03-01 13:10 -------
This has indeed nothing to do with the output being redirected to a file, or
stdout, or even being connected (in Fortran way) to a file:
$ cat pr20257.f90
integer, parameter :: NX = 32, NR = 16, NPHI=2
real :: input(0:NX-1, 0:NR-1, 0:NPHI-1)
input(:,:,:) = 0
open (10, file='foo')
write(10,*) input
end
$ gfortran pr20257.f90 && ./a.out
At line 6 of file pr20257.f90
Fortran runtime error: End of record
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20257
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug fortran/20257] Fortran runtime error: End of record occurs when writing large arrays
2005-03-01 2:50 [Bug fortran/20257] New: Fortran runtime error: End of record occurs when writing large arrays kamaraju at gmail dot com
2005-03-01 3:14 ` [Bug fortran/20257] " jvdelisle at verizon dot net
2005-03-01 13:10 ` coudert at clipper dot ens dot fr
@ 2005-03-01 13:12 ` coudert at clipper dot ens dot fr
2005-03-01 13:59 ` [Bug libfortran/20257] " pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: coudert at clipper dot ens dot fr @ 2005-03-01 13:12 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |coudert at clipper dot ens
| |dot fr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20257
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libfortran/20257] Fortran runtime error: End of record occurs when writing large arrays
2005-03-01 2:50 [Bug fortran/20257] New: Fortran runtime error: End of record occurs when writing large arrays kamaraju at gmail dot com
` (2 preceding siblings ...)
2005-03-01 13:12 ` coudert at clipper dot ens dot fr
@ 2005-03-01 13:59 ` pinskia at gcc dot gnu dot org
2005-03-02 9:35 ` coudert at clipper dot ens dot fr
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-01 13:59 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|critical |normal
Status|UNCONFIRMED |NEW
Component|fortran |libfortran
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-03-01 13:59:17
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20257
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libfortran/20257] Fortran runtime error: End of record occurs when writing large arrays
2005-03-01 2:50 [Bug fortran/20257] New: Fortran runtime error: End of record occurs when writing large arrays kamaraju at gmail dot com
` (3 preceding siblings ...)
2005-03-01 13:59 ` [Bug libfortran/20257] " pinskia at gcc dot gnu dot org
@ 2005-03-02 9:35 ` coudert at clipper dot ens dot fr
2005-03-03 10:34 ` coudert at clipper dot ens dot fr
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: coudert at clipper dot ens dot fr @ 2005-03-02 9:35 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From coudert at clipper dot ens dot fr 2005-03-02 09:34 -------
It happens for all kind of output (formatted (direct or sequential) or
unformatted), and is due to gfortran setting an arbitrary maximal length of
10000 chars (this is in current_unit->recl). Since this code doesn't specify a
recl, we use the default:
io.h:#define DEFAULT_RECL 10000
I don't see a reason for setting so low a value. I will ask later today on the
gfortran mailing-list about the reasons behind this choice. Hope we can fix this
quickly.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20257
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libfortran/20257] Fortran runtime error: End of record occurs when writing large arrays
2005-03-01 2:50 [Bug fortran/20257] New: Fortran runtime error: End of record occurs when writing large arrays kamaraju at gmail dot com
` (4 preceding siblings ...)
2005-03-02 9:35 ` coudert at clipper dot ens dot fr
@ 2005-03-03 10:34 ` coudert at clipper dot ens dot fr
2005-03-03 13:08 ` coudert at clipper dot ens dot fr
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: coudert at clipper dot ens dot fr @ 2005-03-03 10:34 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From coudert at clipper dot ens dot fr 2005-03-03 10:34 -------
Partial fix proposed here: http://gcc.gnu.org/ml/fortran/2005-03/msg00023.html
This fixes the bug when writing to files, but there still is the case of
preconnected units (stdout, stderr). This will need a little more thinking.
Reduced test case for preconnected units:
real :: array(10000)
array(:) = 0
write(*,*) array
end
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20257
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libfortran/20257] Fortran runtime error: End of record occurs when writing large arrays
2005-03-01 2:50 [Bug fortran/20257] New: Fortran runtime error: End of record occurs when writing large arrays kamaraju at gmail dot com
` (5 preceding siblings ...)
2005-03-03 10:34 ` coudert at clipper dot ens dot fr
@ 2005-03-03 13:08 ` coudert at clipper dot ens dot fr
2005-03-18 7:11 ` fxcoudert at gcc dot gnu dot org
2005-09-25 20:29 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: coudert at clipper dot ens dot fr @ 2005-03-03 13:08 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From coudert at clipper dot ens dot fr 2005-03-03 13:08 -------
Complete patch is here: http://gcc.gnu.org/ml/fortran/2005-03/msg00024.html
Note: this just makes the limit higher (1 Gb), but there still is a limit on the
size of things you can write to preconnected units.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20257
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libfortran/20257] Fortran runtime error: End of record occurs when writing large arrays
2005-03-01 2:50 [Bug fortran/20257] New: Fortran runtime error: End of record occurs when writing large arrays kamaraju at gmail dot com
` (6 preceding siblings ...)
2005-03-03 13:08 ` coudert at clipper dot ens dot fr
@ 2005-03-18 7:11 ` fxcoudert at gcc dot gnu dot org
2005-09-25 20:29 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-03-18 7:11 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
CC|coudert at clipper dot ens |fxcoudert at gcc dot gnu dot
|dot fr |org
Last reconfirmed|2005-03-01 13:59:17 |2005-03-18 07:11:28
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20257
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libfortran/20257] Fortran runtime error: End of record occurs when writing large arrays
2005-03-01 2:50 [Bug fortran/20257] New: Fortran runtime error: End of record occurs when writing large arrays kamaraju at gmail dot com
` (7 preceding siblings ...)
2005-03-18 7:11 ` fxcoudert at gcc dot gnu dot org
@ 2005-09-25 20:29 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-09-25 20:29 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |minor
Last reconfirmed|2005-06-17 15:14:59 |2005-09-25 20:28:59
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20257
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2005-09-25 20:29 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-01 2:50 [Bug fortran/20257] New: Fortran runtime error: End of record occurs when writing large arrays kamaraju at gmail dot com
2005-03-01 3:14 ` [Bug fortran/20257] " jvdelisle at verizon dot net
2005-03-01 13:10 ` coudert at clipper dot ens dot fr
2005-03-01 13:12 ` coudert at clipper dot ens dot fr
2005-03-01 13:59 ` [Bug libfortran/20257] " pinskia at gcc dot gnu dot org
2005-03-02 9:35 ` coudert at clipper dot ens dot fr
2005-03-03 10:34 ` coudert at clipper dot ens dot fr
2005-03-03 13:08 ` coudert at clipper dot ens dot fr
2005-03-18 7:11 ` fxcoudert at gcc dot gnu dot org
2005-09-25 20:29 ` pinskia 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).