Mail Archives: djgpp/2001/01/27/03:46:09
> From: rpolzer AT web DOT de (Rudolf Polzer)
> Newsgroups: comp.os.msdos.djgpp
> Date: Fri, 26 Jan 2001 22:30:30 +0100
>
> Martin Stromberg <eplmst AT lu DOT erisoft DOT se> schrieb folgenden Unsinn:
> > Rudolf Polzer (rpolzer AT web DOT de) wrote:
> > : The only memory allocation problems that really can occur in C++ are NULL
> > : pointers (caught by the processor => SIGSEGV) and memory leaks (then you
> >
> > That (getting SIGSEGV) won't work on WINDOZE if I'm not mistaken. Why
> > don't you try it and see for yourself?...
>
> My selfwritten REBOUNCE level editor always crashes on exit (after
> saving) with a SIGSEGV and I do not know (probably I am freeing a bitmap
> twice) why, but RHIDE always crashes after that so I cannot debug it. But
> from this I know that SIGSEGV can also be caught on Windoze.
There are several different exceptions that DJGPP maps into SIGSEGV.
Martin was talking about the one which happens because of NULL pointer
dereference. This triggers a Page Fault exception under CWSDPMI, but
doesn't trigger any exception at all on Windows. The reason is that
the DJGPP startup code unmaps the null page (the first 4KB of the
address space) from the program's address space, but Windows doesn't
support the DPMI function used to do that.
Next time you get a SIGSEGV, read carefully the second line in the
crash message. That line tells what kind of exception crashed your
program; on Windows you will usually see "General Protection Fault",
not a "Page Fault".
The DJGPP FAQ list has more about this in section 12.2.
Btw, you should probably debug that SIGSEGV in your editor. Perhaps
section 12.2 in the FAQ can give you some ideas.
- Raw text -