Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: rav@goanna.cs.rmit.edu.au (robin)
Subject: Re: fortran error?
Date: 1998/03/12	[thread overview]
Message-ID: <6e8j1l$79o$1@goanna.cs.rmit.edu.au> (raw)
In-Reply-To: 3507A4A5.F8A7DDC2@matd.tu-graz.ac.at


	Armin Leuprecht <leu@matd.tu-graz.ac.at> writes:

	>Dynamic allocation using DEC Fortran is working in general.
	>For some strange reason sometimes a programm like the following
	>will crash with a segmentation fault while allocating the memory
	>in line 3 of the subroutine.
	>Though I couldn't reproduce the error with this little program
	>(not even for large values, i.e. more than physical installed
	>memory) I cannot locate another source of failure in my application.

	>	SUBROUTINE sub(n)
	>	INTEGER n
	>	REAL*4  a(n)
	>	END

	>	PROGRAM test
	>	INTEGER n
	>	n = 1234
	>	CALL sub(n)
	>	END

	>My application is of course more complex so that I can't post it
	>as whole. The subroutine looks like this:

	>	SUBROUTINE name (n, a, x, b)

	>	INTEGER n
	>	REAL    a(*), x(*), b(*)

	>c *** local variables

	>	REAL p(n)
	>	REAL r(n)
	>	REAL s(n)
	>	REAL t(n)
	>	REAL z(n)

	>...

	>in fact there are 10 such arrays dimensioned with n, and regardless of
	>the order of variables, the program crashes while allocating memory for
	>the sixth array.
	>So it seems to depend on the amount of requested memory.

	>We had no problem with that subroutine before the operating system
	>upgrade from V2.1 to V3.2

	>My OS:       OSF1 V3.2 148 alpha
	>My Compiler: DEC Fortran for OSF/1 AXP Systems version T3.6

	>thanks for any advice
	>Armin

Programs that exhibit erratic behaviour are more likely to have
a subscript error.

The request for automatic storage for 6 arrays of
size 1234 each cannot be considered to be demanding.

Your program uses assumed size dummy arrays for subroutine
"name" (x, a, b)
rather than assumed shape arrays.  Subscript checking is
not generally carried our for assumed size arrays, whereas
it usully can be requested and applied for assumed shape.

Have you considered substituting assumed shape
arrays and turning on subscript checking?



  reply	other threads:[~1998-03-12  5:00 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-03-12  5:00 fortran error? Armin Leuprecht
1998-03-12  5:00 ` robin [this message]
1998-03-16  5:00 ` Steve Lionel
1998-03-17  5:00   ` Peter Shenkin
1998-03-17  5:00     ` Craig Burley
1998-03-17  5:00       ` Peter Shenkin
1998-03-18  5:00         ` Toon Moene
1998-03-18  5:00           ` Jeff Drummond
1998-03-19  5:00           ` Peter Shenkin
1998-03-18  5:00         ` Craig Burley
1998-03-19  5:00           ` Peter Shenkin
1998-03-19  5:00             ` Craig Burley
1998-03-20  5:00               ` Nick Maclaren
1998-03-20  5:00               ` Peter Shenkin
1998-03-20  5:00                 ` Richard Maine
1998-03-20  5:00                 ` Craig Burley
1998-03-20  5:00                   ` Nick Maclaren
1998-03-20  5:00                     ` Richard Maine
1998-03-20  5:00                   ` Peter Shenkin
1998-03-23  5:00                     ` Craig Burley
1998-03-23  5:00                       ` Craig Burley
1998-03-23  5:00                         ` Peter Shenkin
1998-03-24  5:00                           ` Craig Burley
1998-03-24  5:00                             ` Nick Maclaren
1998-03-23  5:00                       ` Summary (I hope) failure of automatic allocation; was, " Peter Shenkin
1998-03-24  5:00                         ` Craig Burley
1998-03-20  5:00             ` Dick Hendrickson
1998-03-20  5:00               ` Peter Shenkin
1998-03-20  5:00               ` Craig Burley
1998-03-20  5:00                 ` Peter Shenkin
1998-03-23  5:00                   ` Craig Burley
1998-03-18  5:00     ` Steve Lionel
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox