Date: Mon, 01 Aug 2011 17:22:41 +0300 From: Andriy Gapon <avg@FreeBSD.org> To: John Baldwin <jhb@FreeBSD.org> Cc: freebsd-current@FreeBSD.org, Andrew Thompson <andy@fud.org.nz> Subject: Re: variable init Message-ID: <4E36B6B1.60804@FreeBSD.org> In-Reply-To: <201108010852.37607.jhb@freebsd.org> References: <CAFAOGNRN3e_9SyHU5yfRf-EhEWbWhpepCVQT-=n4LL-V44J1EQ@mail.gmail.com> <201108010852.37607.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
on 01/08/2011 15:52 John Baldwin said the following: > 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. Tangentially related: kib has/had a patch for proper hiding of static symbols from kernel runtime linker symbol resolution. It would be nice to get that into the tree some day. -- Andriy Gapon
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E36B6B1.60804>