Mail Archives: djgpp/1996/10/04/20:04:07
Tom Wheeley wrote:
>
> A reasonably large program I am writing *sometimes* crashes out with a Page
> Fault. When I run symify, the fault appears to be in malloc
> ( _malloc+192 to be exact). However, I suspect this is caused by a wild
> pointer of my own.
>
> Tracing the flow, the error occurs in the middle of a lot of small mallocs
> (generally 1 - 10 bytes).
>
> AFAICS, I have set all my pointers to be initialised to NULL, but the error
> still occurs sometimes. I'm using -O3 at the moment.
How many blocks of memory are you trying to allocate simultaneously? If
it is a fairly large number, then you are probably running afoul of a
well-known bug in version 1 of CWSDPMI. This version did not have
sufficient heap space to allocate large numbers of memory blocks, and
instead of detecting this condition and returning an error, it simply
crashed your system.
For one solution, download the patch which allows you to partially fix
this problem at the following URL:
ftp://ftp.neosoft.com/pub/users/s/sandmann/csdpmi1heapfix.zip
However, the best solution is to upgrade to the latest version of
CWSDPMI, version 3, which fixes this and a couple of other bugs,
available as:
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2misc/csdpmi3b.zip
Good luck!
John
--
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I | fighteer AT cs DOT com |
| * Proud user of DJGPP! * | http://www.cs.com/fighteer |
| ObJoke: If Bill Gates were a robber, not only would he |
| shoot you, but he'd send you a bill for the bullets. |
---------------------------------------------------------------------
- Raw text -