Mail Archives: djgpp/2000/02/06/09:14:25
On Sun, 6 Feb 2000 majzikm AT softhome DOT net wrote:
> I am just writing a C++ program with DJGPP.
> It uses "new" to allocate memory. However sometimes
> I get an error saying General protection fault when my
> program uses "new".
Crashes inside `new'/`delete' (or `malloc'/`free', their C counterparts)
are usually symptoms of programs that write beyond the end of allocated
buffers. See section 9.2 of the DJGPP FAQ list (v2/faq230b.zip from the
usual DJGPP sites) for more information. That section also suggests to
use an malloc debugging package such as YAMD to track down these problems.
In general, when a program crashes and you ask for help in solving that,
you should always post here the complete crash message, after running
SYMIFY on it. The crash message includes several important hints about
the nature of the problem, which some people here can read and
undersdand, and that will allow them to help you much more efficiently.
Section 12.2 of the FAQ explains how to interpret important parts of the
crash message; I suggest to read that section.
> It has to allocate a lot of small memories.
> I read somewhere that this is the problem.
> So I tried both cwsparam (Paragraphs of memory for extra CWSDPMI
> internal heap..) and stubedit to increase the site of stack.
Are you running your programs on DOS or on Windows? If you run them on
Windows, the possible problems with CWSDPMI are not relevant, since
CWSDPMI is not used on Windows.
- Raw text -