[TALK] Proving fundamental Unix guarantees

Conrad Parker conrad at metadecks.org
Mon Jun 30 15:34:38 EST 2003


On Mon, Jun 30, 2003 at 02:53:28PM +1000, Adam Donnison wrote:
> 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.

no, you're thinking of the data section, bss is the bullshit section
(the compiler simply records the size of this section in total whereas
it must store all the initial values of the data section)

for more detail, see your compiler manual and not the BSS home page:
http://www.sundialsoc.org.uk/

Conrad.

> 
> 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
> 
> _______________________________________________
> Talk mailing list
> Talk at auug.org.au
> http://www.auug.org.au/mailman/listinfo/talk



More information about the Talk mailing list