delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/20/13:00:19

From: "Charles Sandmann" <sandmann AT clio DOT rice DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Symify crash
Date: Sun, 20 Aug 2000 11:20:25
Organization: Aspen Technology, Inc.
Lines: 26
Message-ID: <399fbef9.sandmann@clio.rice.edu>
References: <7263-Sun20Aug2000090732+0300-eliz AT is DOT elta DOT co DOT il>
NNTP-Posting-Host: dcloan.hou.aspentech.com
X-Trace: selma.aspentech.com 966789870 8467 10.32.115.107 (20 Aug 2000 16:44:30 GMT)
X-Complaints-To: postmaster AT aspentech DOT com
NNTP-Posting-Date: 20 Aug 2000 16:44:30 GMT
X-NewsEditor: ED-1.5.8
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> It looks like the call to memset in process_coff was added due to
> specific bug which Charles Sandmann (that's what CWS stands for) found
> while debugging the code.
> 
> I cc: Charles, perhaps he remembers what was that about.

In the beginning there was GO32, and it was good.  It would zero memory when
a page was first touched, on demand.  So when sbrk() asked for memory, it was
zero by default.  Then came Windows.  Windows is a control freak and refused
to let GO32 play in the same sandbox, wanting it to DPMI instead.  GO32 was
taught to DPMI, but DPMI didn't zero memory.  This was faster, but most unix
code is buggy, assuming memory will be zeroed, and there was a plague on the
DPMI code because of the bugs.  The GO32-DPMI was made to zero all memory,
which made it slower, but it ran the buggy code and things were good again.

DJGPP V2 was built on DPMI to begin with, and we decided to fix the "expecting
zeroed memory" bugs instead of having to have zero all memory (there is still 
a crt0 option to turn this on, BTW).  When trying to build edebug32 during the
V2 prototyping stage I found uninitialized memory bugs and fixed them so the
debugger would run.  I didn't analyze every line of code - just found bugs
and fixed them.  The note observed in the code was from one of those fixes.

When I suspect uninitialized memory bugs, I rebuild (or patch the binary image)
to set the crt0 flag to zero memory.  If the bug goes away, smoking gun.  We
should probably run all code with the deadbeaf flag to try and catch these
things but we never had time...

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019