From: Eli Zaretskii Newsgroups: comp.os.msdos.djgpp Subject: Re: Corruption of read-only files on program crash Date: Sun, 12 Dec 1999 14:16:15 +0200 Organization: NetVision Israel Lines: 29 Message-ID: References: <82l8ll$4h2 AT romeo DOT logica DOT co DOT uk> <82o3bs$gnk AT acp3bf DOT knirsch DOT de> <82r9uj$4so AT romeo DOT logica DOT co DOT uk> NNTP-Posting-Host: is.elta.co.il Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: news.netvision.net.il 945000876 11432 199.203.121.2 (12 Dec 1999 12:14:36 GMT) X-Complaints-To: abuse AT netvision DOT net DOT il NNTP-Posting-Date: 12 Dec 1999 12:14:36 GMT X-Sender: eliz AT is In-Reply-To: <82r9uj$4so@romeo.logica.co.uk> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Fri, 10 Dec 1999, Chris Underwood wrote: > >Another thing to keep in mind: off the shelf, a DJGPP program wouldn't > >normally be able to commit this kind of trespass, due to the memory > >protection offered by protected mode. > > This is something which is new to me under DOS. I presume it should also > never take down Windows, since any memory accesses outside my program bounds > should cause a SIGSEGV or similar. It can crash Windows though. Actually, Windows is not very good at protecting itself from runaway programs. It is true that most bugs only crash the offending program, sometimes together with the DOS box. But some more blatant errors, such as allocating 64MB of memory, then paging it in and locking all of it, are known to wedge Windows. I'm guessing that, since the Windows built-in DPMI server is central to the operation of the Windows kernel itself, it cannot be protected too much because the kernel probably plays some dirty tricks of its own. > Could I be using the nearptr you're talking about inadvertantly? One of the libraries that your program is linked against could use near pointers. Btw, if some of the crashes result in the nomal DJGPP crash message, please post it here, complete with the registers' dump and call stack traceback. Sometimes, just by looking at that info, knowledgeable people could give you enough hints to find and correct the bug(s).