Mail Archives: djgpp/1998/07/20/10:17:10
Message-ID: | <300E8D35.739@linetap.com>
|
From: | nebo <nebo AT linetap DOT com>
|
Organization: | neboland
|
MIME-Version: | 1.0
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Page fault error
|
Lines: | 36
|
Date: | Mon, 20 Jul 1998 13:57:24 GMT
|
NNTP-Posting-Host: | 209.205.49.226
|
NNTP-Posting-Date: | Mon, 20 Jul 1998 09:57:24 EDT
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Im currently writing a relatively large program(200k code)
and I keep getting a page fault error. I know what it is,
but not why it's happening, I'd post the code, but the
relevant portion is about 20k.
One function is systematically called a user-defined number
of times by another function. The called function uses calloc()
4 or 5 times, in order to allocate 81 bytes/calloc call, and once
the caller is done, the caller then frees the memory via a global
variable pointer array.
The global variable holds 20000 entries, but the program crashes
after 15800 or so. The called function also uses sprintf() to
assign a string to the new memory.
I have sufficient memory, and have spent too much time on this
already, does anyone have any thoughts or ideas??
The program works perfectly as long as the total number of calls
to calloc() is below 15800, give or take... I haven't tried
using malloc instead(my next step), but would much prefer
to use calloc().
Im running gcc 2.7.2.1, under DOS 6.22 on a 486DX/40.
--
Nb
nebo AT LTS MajorNet
nebo AT linetap DOT com Internet
I'll stop drinking when I can't pour,
I'll stop standing when I fall over,
I'll stop moving when I pass out,
I'll stop dreaming when I die.
- Raw text -