delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/02/09/04:32:06

Date: Fri, 09 Feb 2001 10:49:47 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: djgpp AT delorie DOT com
Message-Id: <4331-Fri09Feb2001104946+0200-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6
In-reply-to: <95up73$63a$1@nnrp1.deja.com> (dcasale@my-deja.com)
Subject: Re: GP fault on a new -- why?
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1010208102939 DOT 20284Y-100000 AT is> <95up73$63a$1 AT nnrp1 DOT deja DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: dcasale AT my-deja DOT com
> Newsgroups: comp.os.msdos.djgpp
> Date: Thu, 08 Feb 2001 18:40:37 GMT
> > >
> > > General Protection Fault at eip-3af9d; flags=3046
> > > eax=00043406 ebx=000100af ecx=00af00a7 edx=0000001c esi=00af00bf
> > > edi=00000000 ebp=0004342c esp=0000227a cs=a7 ds=a7 es=af fs=bf gs=bf
> > > ss=33 error=0000
> >
> > You will see in section 12.2 that this message comes from CWSDPMI.  It
> > means you crashed the machine so badly that CWSDPMI aborted itself.
> 
> Section 12.2 of the FAQ only referred to CWSDPMI in connection with a
> _Page Fault_.  This was a _General Protection Fault_.  If the FAQ
> doesn't specifically say that General Protection Faults can also come
> from CWSDPMI, how am I supposed to know?

Thanks for pointing this out.  Yes, the FAQ is not clear enough on
that; I'll fix that in the next release.

> > The code which crashes is at 0x3af9d.  Can you see what's there?  One
> > way is to load the program into GDB, then type "list *0x3af9d".  You
> > should see the listing of several source lines around the point where
> > it crashes.  If "list" doesn't work, try "disassemble 0x3af9d", which
> > should at least say inside what function did it happen.
> 
> I disassembled it, and it says it's from __djgpp_exception_table.

Sigh.  It figures: smashing __djgpp_exception_table and the associated
exception handler code is one of the reasons for crashes inside
CWSDPMI.

Unfortunately, this is not easy to debug.  Probably the simplest, if
somewhat tedious, way is to introduce debugging printf's into the
vicinity of where it crashes in your program, then halving the
interval to zero in on the offending line.

When you have the line in your source where it crashes, if you cannot
figure out why does that happen, try running the program under a
debugger, stop it a few lines before it is going to crash, and examine
crucial variables.  (You can do this with debugging printf's as well,
if you prefer.)

> not_forced:
> 	movw	%cs:___djgpp_our_DS, %ds
> 	movl	$0x10000, forced  <-----	/* its zero now, flag
> inuse */
> 	movl	$exception_state, %ebx
> 
> I still have no idea what this means.  I'm guessing that it crashed
> while trying to throw an exception, but that doesn't tell me what I
> need to do to fix the problem.  *shrugs*

It usually means that your program was going to crash due to SIGSEGV,
but it was so deeply in trouble that the code which handles the GPF
exception also crashed, and CWSDPMI took the blow.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019