[TALK] Proving fundamental Unix guarantees

Adam Donnison adam at saki.com.au
Mon Jun 30 14:53:28 EST 2003


Wiser heads than mine may well contradict me here, however my
understanding is as follows.  BSS contains initialised global
variables, however this is done by the compiler, not the OS.
Other memory, allocated on either the stack or the heap, is
not initialised and may contain trash.

Adam

Gary Schmidt wrote:
>>This may be a bit too work-related for this list, but anyway:
>>
>>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
> 
> No, it is not nonsense.
> 
> There is no guarantee that uninitialised memory will be set to anything.
> 
> On some UNICES memory _may_ be initialised, but don't rely on it.
> 
> I don't have any POSIX or SVID citations for it, just twenty-odd years, and the current half-a-dozen different UNIX boxen in front of me.
> 
> 	Cheers,
> 		Gary	B-)
> _______________________________________________
> Talk mailing list
> Talk at auug.org.au
> http://www.auug.org.au/mailman/listinfo/talk


-- 
Adam Donnison                                  email: adam at saki.com.au
Saki Computer Services Pty. Ltd.
93 Kallista-Emerald Road                        phone: +61 3 9752 1512
THE PATCH  VIC 3792    AUSTRALIA                fax:   +61 3 9752 1098




More information about the Talk mailing list