Date: Tue, 8 Jun 1999 11:31:17 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: north AT iname DOT com cc: djgpp AT delorie DOT com Subject: Re: What about the registers???? In-Reply-To: <7jg9v2$l6l$1@nnrp1.deja.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 7 Jun 1999 north AT iname DOT com wrote: > My program crashes due to a GPF. > Can somebody please explain what one can read out from all > the regiser results as shown below The FAQ explains how to read these in section 12.2. I will try to give you some more hints below. > Call frame traceback EIPs: > 0x00001016 Observation no.1: you didn't get the usual stack traceback, only a single EIP. This usually means some stack-related problems, which prevent the exit code from unwinding the stack and printing the other EIP values. > Exiting due to signal SIGSEGV > General Protection Fault at eip=00001016 Observation no.2: the EIP value is too low to be right. The entry point into a DJGPP program is usually 0x10a8, so the value of 0x1016 is probably garbled, and is most probably the cause of the GPF. > ebp=007b00a1 esp=0008f88f program=C:\DJGPP\USER\DATABAS\DBASE3.EXE > App stack: [000934f4..000134f4] Exceptn stack: [000133d8..00011498] Observation no.3: EBP contains garbage: it is outside the limits of the stack (printed inside brackets). This is consistent with the first observation, meaning some stack problems, and is usually a result of some code overwriting the stack. Observation no.4: ESP, while seemingly valid, indicates some pretty deep stack usage (12KB). Is this a recursive program, or can it be that some function uses a lot of stack space due to large automatic arrays? If not, perhaps this ESP value is part of the problem. Analysis: my first guess would be that some code overwrote the stack, e.g. by running off limits of an array or a string. I suggest to under a debugger, and when it crashes, examine variables around and inside the function whose code GPFaulted. Add some debugging printf's if you cannot figure out which function runs last before the program crashes.