From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,1ef3b84ca62fad7b X-Google-Attributes: gidfee84,public X-Google-Thread: 1094ba,1ef3b84ca62fad7b X-Google-Attributes: gid1094ba,public From: rav@goanna.cs.rmit.edu.au (robin) Subject: Re: fortran error? Date: 1998/03/12 Message-ID: <6e8j1l$79o$1@goanna.cs.rmit.edu.au>#1/1 X-Deja-AN: 333307224 Expires: 12 June 1998 00:00:00 GMT References: <3507A4A5.F8A7DDC2@matd.tu-graz.ac.at> Organization: Comp Sci, RMIT University, Melbourne, Australia. NNTP-Posting-User: rav Newsgroups: comp.lang.fortran,comp.unix.osf.osf1 Armin Leuprecht 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?