From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1094ba,1ef3b84ca62fad7b X-Google-Attributes: gid1094ba,public X-Google-Thread: fee84,1ef3b84ca62fad7b X-Google-Attributes: gidfee84,public From: Peter Shenkin Subject: Summary (I hope) failure of automatic allocation; was, Re: fortran error? Date: 1998/03/23 Message-ID: <3516D163.2781@still3.chem.columbia.edu>#1/1 X-Deja-AN: 336946512 Content-Transfer-Encoding: 7bit References: <3507A4A5.F8A7DDC2@matd.tu-graz.ac.at> <6ejfii$kbd@usenet.pa.dec.com> <350E95A7.41C6@still3.chem.columbia.edu> <350EDA13.2781@still3.chem.columbia.edu> <351181DB.2781@still3.chem.columbia.edu> <351296BC.167E@still3.chem.columbia.edu> <3512FE4B.2781@still3.chem.columbia.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: MacroModel Development Group, Columbia University Newsgroups: comp.lang.fortran,comp.unix.osf.osf1 Craig Burley wrote: > > Peter Shenkin 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 *