Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!ICAEN.UIOWA.EDU!dbfunk From: dbfunk@ICAEN.UIOWA.EDU (David B. Funk) Newsgroups: comp.sys.apollo Subject: Re: Problems with invalid stack frame Message-ID: <8812100358.AA05936@umaxc.weeg.uiowa.edu> Date: 10 Dec 88 03:22:27 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: Iowa Computer Aided Engineering Network, University of Iowa Lines: 45 WRT posting <914@nic.MR.NET> from pabong@gonzo.eta.com (Paul A. Bong): > Occasionally, a program will die with the following error: > >?(sh) "./fs_dump" - unable to unwind stack because of invalid stack frame > (process manager/process fault manager) When a process faults (access violation, odd address trap, divide by zero, etc) the process manager tries to walk back thru the process' stack so as to be able to store a trace-back, look for resources that need to be released, and do general cleaning up. It does this by looking for various land-marks that are stored on the stack, return addresses, stack base pointers, etc. If the program was very badly behaved and wiped out the information stored on its stack before dieing, then this information can be lost. When this happens, the fault manager gives you the above error message. So when you see that error message, it indicates a process that was writing values in memory in places that it shouldn't have. There are many ways this can happen, here are some of the more common: 1) The number of arguments in a procedure call don't match the number of arguments in the procedure's parameter list. IE calling a subroutine with 3 arguments when it expects 4. 2) The type of arguments in a procedure call don't match the type of arguments in the procedure's parameter list. IE calling a subroutine with simple variables when it expects arrays. 3) Indexing outside the bounds of an array. IE trying to store 20 values in an array that was dimensioned with 10 elements. Using a negative index in an array. 4) Using an uninitialized or corrupted pointer. Usually caused by a coding error in pointer usage, but good pointer code can go wrong when a pointer is damaged. Pointer corruption can be caused by one of the preceeding problems or by using a pointer returned by a system call without first checking the returned status to see if the call worked. 5) The stack frame was already messed up by the previous running of a miscreant program. This is very rare but possible. Try running the offending program in a fresh shell. These kinds of problems can be very hard to catch because they destroy the incriminating evidence. Dave Funk University of Iowa