On Mon, Aug 1, 2011 at 12:09 AM, Andrew Thompson <andy_at_fud.org.nz> wrote: > Hi, > > Looking at, > > http://www.freebsd.org/cgi/query-pr.cgi?pr=159345 > > The lock is a global variable, declared as > > static struct mtx lagg_list_mtx; > > I would expect this to be zeroed memory, is this guaranteed? It depends. :-) The C standard mandates that this storage be zero. However, seeing as we're the operating system, it's our job to do it. For an application program the zero'd storage is zeroed by the loader. For the operating system, exactly when it's initialized is an architectural decision. I believe that the zeroed storage of FreeBSD is cleared by the boot loader before it transfers control to the operating system. (For reference, on AIX the storage is cleared by the virtual memory management code during bringup of the VMM leading to interesting bugs when some variables used in early boot weren't initialized). Cheers, matthewReceived on Mon Aug 01 2011 - 12:16:06 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:16 UTC