cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/28/05:10:42

From: "Michael Beck" <beck AT dresearch DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: HELP! SIGSEGV Page Fault
Date: Mon, 28 Dec 1998 10:54:34 +0100
Organization: DResearch
Lines: 38
Message-ID: <767ke6$e4l$1@latinum.dresearch.de>
References: <7677mg$ri0$1 AT nnrp1 DOT dejanews DOT com>
NNTP-Posting-Host: 195.99.74.37
X-Trace: latinum.dresearch.de 914838790 14485 192.168.0.15 (28 Dec 1998 09:53:10 GMT)
X-Complaints-To: postmaster AT DResearch DOT DE
NNTP-Posting-Date: 28 Dec 1998 09:53:10 GMT
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Cache-Post-Path: eubuf61.eu.concert.net!unknown AT 194 DOT 75 DOT 26 DOT 11
X-Cache: nntpcache 2.3.2.1 (see http://www.nntpcache.org/)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

leonj AT geocities DOT com wrote in message <7677mg$ri0$1 AT nnrp1 DOT dejanews DOT com>...
>Im having a problem that's ticking me off.
>I picked up a tutorial for Allegro from:

[...]

>
>Shutting down Allegro
>Exiting due to signal SIGSEGV
>Page fault at eip=00012996, error=0004
>eax=00000000 ebx=00000000 ecx=00000100 edx=000003c9 esi=0f580000
edi=00042270


Looks like a NULL pointer access. Look at the eax, ebx registers.

>
>set_pallette((RGB*)data[TUT_GAMEPAL].dat);
>
add a check for NULL pointer before calling set_palette, for instance:

#inlcude <assert.h>

...

assert(((RGB*)data[TUT_GAMEPAL].dat != NULL);
set_pallette((RGB*)data[TUT_GAMEPAL].dat);

Now, if your program stops with an 'assertion failed' message, check while
this is NULL.

Hope that helps,
--
Michael Beck,                   email: beck AT dresearch DOT de



- Raw text -


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