Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Craig Burley <burley@tweedledumb.cygnus.com>
Subject: Re: fortran error?
Date: 1998/03/17	[thread overview]
Message-ID: <y64t0xjlxq.fsf@tweedledumb.cygnus.com> (raw)
In-Reply-To: 350E95A7.41C6@still3.chem.columbia.edu


Peter Shenkin <shenkin@still3.chem.columbia.edu> writes:

> I would really like to see an addition to the standard which requires
> inability to "allocate" an automatic to be treated similarly to
> the treatment of inability to ALLOCATE an ALLOCATABLE when no STATUS
> variable is supplied:  namely, stop the program with a descriptive
> error message.  I believe the Absoft compilers do this (at least
> the LINUX one.)
> 
> Quality of implementation should demand even more than this:  if
> an automatic cannot be "allocated" on the stack, the run-time system
> should allocate it on the heap.

Ah, a voice of sanity, clearly unfettered by any in-depth knowledge
of popular computer architectures, operating systems, or compiler
code-generation techniques.  ;-)

Yes, like you might, I can certainly expound on many reasons I
know of, having expertise in *those* topics, that your suggestions
are infeasible or, at least, would be unpopular among Fortran
implementors of most any stripe.

However, as someone whose seen this issue come up over and over
again for, well, decades, in various guises, I can really only
say "Hallelujah!" and, then, "...we'll figure out later how
to make it work reliably *and* fast".

(In short, the problem is this: on most systems, dynamically
allocating and later deallocating space on the stack is very fast,
*especially* if you don't care about elegantly catching the
situation where there isn't enough space on the stack.  Mandating
that Fortran implementations provide a more-elegant diagnostic for
this requires either a somewhat slower mechanism, or more, perhaps
much more, cooperation from some combination of the linker,
operating system, or CPU and its architecture.)

In the meantime, maybe someone can look into fixing Linux so its
default behavior for handling SEGV that seems to involve a
stack overflow includes printing some message like "stack
overflow".

(As far as systems that cannot handle invoking user-defined
signal handlers when the stack overflow...well, I don't think
I'm used to that, guess there's not as much call for that
sort of thing as there was long ago.  Certainly there's no
real technical impediment to it I can think of.)
-- 

"Practice random senselessness and act kind of beautiful."
James Craig Burley, Software Craftsperson    burley@gnu.org



  reply	other threads:[~1998-03-17  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 [this message]
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               ` 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               ` Nick Maclaren
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