Mail Archives: djgpp/1997/03/03/02:58:12
Eli Zaretskii (eliz AT is DOT elta DOT co DOT il) writes:
> On Thu, 27 Feb 1997, Mark T Logan wrote:
>
>> I looked all over the DJGPP docs, but I couldn't find
>> any error number listings. My program is crashing
>> with a page fault, and error 0004. What is error 0004?
>
> Please post a complete traceback printed when the program crashes. It
> is very hard to answer your question otherwise.
0004 is general protection fault.
* Array access out of bounds
* Malloc access out of bounds
* Null pointer usage (see below)
* Pointer used before initialized
* Pointer from a malloc used before checking for NULL (but NULL from
malloc is very rare if you have reasonable RAM and free disk, under GCC!)
below:
void main (void) {
int a;
a= *((int *)0);
}
This will cause a GPF.
Beware dereferencing NULL!
--
.*. Where feelings are concerned, answers are rarely simple [GeneDeWeese]
-() < When I go to the theater, I always go straight to the "bag and mix"
`*' bulk candy section...because variety is the spice of life... [me]
Paul Derbyshire ao950 AT freenet DOT carleton DOT ca, http://chat.carleton.ca/~pderbysh
- Raw text -