From owner-freebsd-current@FreeBSD.ORG Mon Aug 1 13:59:40 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24434106564A for ; Mon, 1 Aug 2011 13:59:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id ED6B08FC0A for ; Mon, 1 Aug 2011 13:59:39 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 98D9546B32; Mon, 1 Aug 2011 09:59:39 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 38ACD8A037; Mon, 1 Aug 2011 09:59:39 -0400 (EDT) From: John Baldwin To: freebsd-current@freebsd.org Date: Mon, 1 Aug 2011 08:52:37 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110617; KDE/4.5.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201108010852.37607.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 01 Aug 2011 09:59:39 -0400 (EDT) Cc: Andrew Thompson Subject: Re: variable init X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2011 13:59:40 -0000 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