F77 1.3.1 bugs?

Lew Jansen lrj at cs.cornell.edu
Tue Nov 27 04:30:00 AEST 1990


This is being posted for someone who does not have access to Usenet.
Please send replies to me, and I'll pass them on.  This has also been sent
to hotline at sun.com


    -- Lewis R. Jansen, N2KNV		lrj at helios.tn.cornell.edu
    LASSP/LNS Systems Manager		     (607) 255-6065

========================================================================

The attached FORTRAN test program gave me segmentation violation errors
when run with the number of numbers in the binary array output exceeded
2047.  This happened only with the 1.3.1 compiler and on the machines
noted below..   I ran the same program with no trouble on a sparc with
sunOS 4.0 and fortran 1.2.  I believe that the fortran is correct.  In
veiw of the critical value of nn should one expect a buffering problem.
There was no trouble doing formatted writes on any machine.  Please advise
on fixes.

Problem machines and F77

Sun 3/160 with FPA (not used)
fortran version  f771.3.1FCS  90/06/25
SunOS  4.1

Sun SPARCstation 1
SunOS  4.0.3c  (generic)
fortran version    same as above.

	program main
	dimension x(10000)
	do 100 i=1,10000
100	x(i)=i+sqrt(2.)
	read(5,*) nn
	call writ(x,nn)
	stop
	end
	subroutine writ(x,nn)
	dimension x(1)
c  problems persisted with   dimension x(nn) and unformatted
c  Formatted writes below work fine
c	open (10,file='binary',form='formatted')
c	write(10,*) (x(i),i=1,nn)
c  following write gave segmentation violation with nn>= 2047 = 2**11-1
 	open (10,file='binary',form='unformatted')
 	write(10) (x(i),i=1,nn)
	write(6,*) x
	stop
	end



More information about the Comp.sys.sun mailing list