delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/31/15:21:04

Date: Tue, 31 Aug 1999 09:28:30 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Dave Bird <dave AT xemu DOT demon DOT co DOT uk>
cc: djgpp AT delorie DOT com
Subject: Re: Error General Fault Protection on quit???
In-Reply-To: <cfalCTBApoy3EwWV@xemu.demon.co.uk>
Message-ID: <Pine.SUN.3.91.990831092806.9517C-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 30 Aug 1999, Dave Bird wrote:

> >   void validate_or_die (void *ptr)
> >   {
> >     if ( (unsigned)p < 0x1000)
> >       abort ();
> >   }
> 
>  Sounds possible... I'd prefer to log or report rather than abort,

That's up to you, but `abort' has an advantage of producing a
traceback, which shows you the entire sequence of function calls that
led to the problem; whereas in a log message it is not trivial to
print enough information to let you know who's the villain.

Anyway, why let a program that dereferences NULL run? ;-)

>  and is there an upper limit??

The upper limit is the data segment limit.  But you don't have to
check that, since any protected-mode environment, including Windows,
catches those cases and crashes your program with a GPF.

- Raw text -


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