Re: variable init

From: John Baldwin <jhb_at_freebsd.org>
Date: Mon, 1 Aug 2011 08:52:37 -0400
On Monday, August 01, 2011 3:09:27 am Andrew Thompson 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?

Yes, but when if_lagg.ko is loaded, the runtime linker resolves references to 
'lagg_list_mtx' to point to the lock that is in the kernel's .bss from the 
compiled-in lagg, not the one in the .ko file.  However, both initializer 
functions run (the one from the kernel and the one from the .ko) which causes 
the panic.

-- 
John Baldwin
Received on Mon Aug 01 2011 - 11:59:40 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:16 UTC