[TALK] Proving fundamental Unix guarantees

Edwin Groothuis edwin at mavetju.org
Mon Jun 30 12:13:27 EST 2003

On Mon, Jun 30, 2003 at 11:44:16AM +1000, Peter Jeremy wrote:
> In response to a query, one of our Unix vendors has stated
> "OS-name-deleted-to-protect-the-guilty does not guarantee that all
> memory given to a program is necessarily initialised" and "there are
> regions known as BSS which hold data (i.e. program variables) which
> ARE NOT INITIALISED.  What this means is that these variables will
> hold whatever was in that memory location before it was allocated to
> them. ...  This is designed behaviour".
> This is, of course, nonsense - Unix does guarantee that all memory
> handed to userland by the kernel _is_ initialised - either from a disk
> image (for text, data) or to zero (for bss).  My problem is that this
> is such a fundamental assumption that it's hard to find this statement
> written down.  Having searched the relevant vendor's on-line
> documentation, I can only find two indirect references to bss being
> initialised to zero.

I think you two are talking on different levels of the programs.
If I, as an application programmer, talk about uninitialised variables
they are the ones which are *allocated* but not *assigned* to
something. While somebody else, as kernel programmer, talks about
uninitialised variables they are the ones which are not yet allocated
in the memory system.

Maybe I'm wrong about it, it happens often.


Edwin Groothuis      |            Personal website: http://www.mavetju.org
edwin at mavetju.org    |    Weblog: http://www.mavetju.org/weblog/weblog.php 

More information about the Talk mailing list