Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Peter Shenkin <shenkin@still3.chem.columbia.edu>
Subject: Summary (I hope) failure of automatic allocation;  was, Re: fortran error?
Date: 1998/03/23	[thread overview]
Message-ID: <3516D163.2781@still3.chem.columbia.edu> (raw)
In-Reply-To: y667l58b9x.fsf@tweedledumb.cygnus.com


Craig Burley wrote:
> 
> Peter Shenkin <shenkin@still3.chem.columbia.edu> writes:
> > ... I'm just saying that when a
> > stack is used, F77 implementations don't compute stack requirements
> > and compare them at startup with available stack resources even when
> > it would be easy to do so.
> 
> Okay, but how often do you think such implementations actually
> overflowed the stack?

Very rarely.  I think that when we closely examine what I said,
what you said, what I said you said and what you said I said,
we'll discover that we agree even on the details.

But even if we don't, what is important is that automatic variables
are often (usually) implemented on the stack, and this makes
ungraceful program termination (typically, an untrappable SEGV)
far more likely than it used to be.

Handling such failures in a friendlier fashion is bound to become
a significant Q-of-I issue in the future -- especially since C
programs that use the new C9x "variable-length array" facility
(a counterpart to Fortran's automatic arrays) are likely to be
susceptible to the same problem.

IMHO, the Fortran standard should mandate an error-handling
mechanism for such events.  At the very least, this should be
a program STOP, and good implementations will say why the program
stopped.

Also in the Q-of-I area, I think compilers should have options to
force automatics to be allocated on the heap, preferably in some
dynamic way.  The simplest would be the Cray method of allowing
a size threshold to be specified such that automatics larger than
this size would be allocated on the heap.  Perhaps better would
be a stack fraction:  if an automatic would take up greater than
this fraction of the remaining available stack, it would be
allocated on the heap.

But avoiding a signal -- especially an untrappable signal --
is the least we can ask of our compiler vendors, even without
anything said in the standard.

	-P.


-- 
************** In memoriam, Grandpa Jones, 1913-1998, R.I.P.
**************
* Peter S. Shenkin; Chemistry, Columbia U.; 3000 Broadway, Mail Code
3153 *
** NY, NY  10027;  shenkin@columbia.edu;  (212)854-5143;  FAX: 678-9039
***
*MacroModel WWW page:
http://www.columbia.edu/cu/chemistry/mmod/mmod.html *



  parent reply	other threads:[~1998-03-23  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
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                 ` 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                       ` Peter Shenkin [this message]
1998-03-24  5:00                         ` Summary (I hope) failure of automatic allocation; was, " Craig Burley
1998-03-20  5:00                 ` Richard Maine
1998-03-20  5:00             ` Dick Hendrickson
1998-03-20  5:00               ` Craig Burley
1998-03-20  5:00                 ` Peter Shenkin
1998-03-23  5:00                   ` Craig Burley
1998-03-20  5:00               ` Peter Shenkin
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