[comp.unix.ultrix] Question about dbx/f77 problem

dittrich@milton.u.washington.edu (Dave Dittrich) (03/20/91)

I have a Fortran program that is crashing on a DECstation 3100 (Ultrix
4.1).  Executing the program produces the following message:

	[2]denali> r3941.
	r3941.: 16852 Memory fault - core dumped

Since the program has some very large arrays, the obvious first move was to
increase the stack limit to make sure I wasn't running out of stack, which was
promptly done ("limit stack 32768" used).  This had no effect.

In order to determine what was causing the fault, I tried using dbx.  When
I did this, dbx promptly barfed on my object file!

	[3]denali> dbx -I../src bfpa. core
	dbx version 2.0
	Type 'help' for help.
	Corefile produced from file "bfpa."
	Child died at pc 0x457954 of signal : Segmentation fault
	reading symbolic information ...
	dbx: internal error: type depleted before dimension reached
	[4]denali>

The error message produced by dbx is, quoting my local Ultrix expert,
"rather opaque."   He checked his system (which has the Ultrix source)
and could not find the source for dbx. (?)

Having no other way of determining what is going on in the code, I am
stuck in getting to the problem behind the segmentation fault.  Any
ideas from you Ultrix gurus?
-- 
Dave Dittrich
dittrich@u.washington.edu     ...!uw-beaver!u.washington.edu!dittrich

frank@croton.nyo.dec.com (Frank Wortner) (03/20/91)

In article <18716@milton.u.washington.edu>,
dittrich@milton.u.washington.edu (Dave Dittrich) writes:
 
> I have a Fortran program that is crashing on a DECstation 3100 (Ultrix
> 4.1).  Executing the program produces the following message:
> 
> 	[2]denali> r3941.
> 	r3941.: 16852 Memory fault - core dumped
> 
 
Sometimes the easiest way to track down non-specific errors like
"memory fault" in Fortran programs is to compile with array
bounds checking turned on.  That's the "-C" option to f77.  It's amazing
how many programs just stomp all over their storage.  (I've seen cases
where this is deliberate, but most often it's an error.)

				Frank