Date: Sat, 27 Jan 2001 10:40:54 +0200 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: rpolzer AT web DOT de (Rudolf Polzer) Message-Id: <9003-Sat27Jan2001104054+0200-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6 CC: djgpp AT delorie DOT com In-reply-to: Subject: Re: Windows ME and DJGPP References: <20010120205730 DOT 25849 DOT 00000491 AT ng-fd1 DOT aol DOT com> <3a6b7917 DOT 10793503 AT news DOT sci DOT fi> <3A6CB71F DOT 8B4E86C9 AT phekda DOT freeserve DOT co DOT uk> <94k3dc$lf9$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> <94pm3k$1qf$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> <94rrk4$sro$1 AT antares DOT lu DOT erisoft DOT se> Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: rpolzer AT web DOT de (Rudolf Polzer) > Newsgroups: comp.os.msdos.djgpp > Date: Fri, 26 Jan 2001 22:30:30 +0100 > > Martin Stromberg 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.