From owner-freebsd-current@FreeBSD.ORG Thu Dec 9 03:10:58 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 69FC016A4CE; Thu, 9 Dec 2004 03:10:58 +0000 (GMT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.176]) by mx1.FreeBSD.org (Postfix) with ESMTP id ED6B843D4C; Thu, 9 Dec 2004 03:10:57 +0000 (GMT) (envelope-from max@love2party.net) Received: from [212.227.126.207] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1CcEhk-0003AQ-00; Thu, 09 Dec 2004 04:10:56 +0100 Received: from [84.128.137.142] (helo=donor.laier.local) by mrelayng.kundenserver.de with asmtp (TLSv1:RC4-MD5:128) (Exim 3.35 #1) id 1CcEhk-0002hQ-00; Thu, 09 Dec 2004 04:10:56 +0100 From: Max Laier To: freebsd-current@freebsd.org Date: Thu, 9 Dec 2004 04:11:26 +0100 User-Agent: KMail/1.7.1 References: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1551341.iXytlVmc3k"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200412090411.42258.max@love2party.net> X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:61c499deaeeba3ba5be80f48ecc83056 cc: gnn@freebsd.org cc: Robert Watson cc: Steve Kargl Subject: Re: protocol timer running before protocol is fully initialized (again) (was re: panic: mtx_lock() of spin mutex ...) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Thu, 09 Dec 2004 03:10:58 -0000 --nextPart1551341.iXytlVmc3k Content-Type: multipart/mixed; boundary="Boundary-01=_jJ8tBMMl+ZnYkYB" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_jJ8tBMMl+ZnYkYB Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 09 December 2004 03:31, Robert Watson wrote: > On Wed, 8 Dec 2004, Steve Kargl wrote: > > panic: mtx_lock() of spin mutex (null) @ sys/netinet/frag6.c:682 > > cpuid =3D 0 > > kdb_backtrace+0x37 > > panic+0x1d1 > > _mtx_lock_flags+0x72 > > frag6_slowtimo+0x26 > > pfslowtimo+0x5a > > softclock+0x1c0 > > ithread_loop+0x179 > > fork_exit+0xe9 > > fork_trampoline+0xe > > > > This is FreeBSD/amd64 from today's sources of about 30 minutes ago. > > > >From the instant interpretation unit: it looks like this is another > > example of a protocl's timeout firing before the protocol is properly > initialized, as the mutex appears to be zero'd due to being in BSS. Here is a lazy fix: http://people.freebsd.org/~mlaier/uipc_domain.c.lazy.diff Should help for (almost) sure. This fixes all domains that are initialized = in=20 SI_SUB_PROTO_DOMAIN, those that are initialized later on (netgraph e.g.) ca= n=20 still trigger this prime example why it's bad to hook something in before=20 initializing it properly. Unfortunately our code and API force us to do so = at=20 the moment :-\ Please tell me if the patch (apply to src/sys/kern/uipc_domain.c) helps. =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --Boundary-01=_jJ8tBMMl+ZnYkYB Content-Type: text/x-diff; charset="iso-8859-1"; name="uipc_domain.c.lazy.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="uipc_domain.c.lazy.diff" =3D=3D=3D=3D //depot/user/mlaier/carp2/sys/kern/uipc_domain.c#3 - /usr/stor= e/mlaier/p4/carp2/sys/kern/uipc_domain.c =3D=3D=3D=3D =2D-- /tmp/tmp.40917.0 Thu Dec 9 04:02:36 2004 +++ /usr/store/mlaier/p4/carp2/sys/kern/uipc_domain.c Thu Dec 9 03:43:12 2= 004 @@ -215,9 +215,6 @@ KASSERT(domain_init_status =3D=3D 0, ("domaininit called too late!")); domain_init_status =3D 1; mtx_unlock(&dom_mtx); =2D =2D callout_reset(&pffast_callout, 1, pffasttimo, NULL); =2D callout_reset(&pfslow_callout, 1, pfslowtimo, NULL); } =20 /* ARGSUSED*/ @@ -228,6 +225,9 @@ KASSERT(domain_init_status =3D=3D 1, ("domainfinalize called too late!")); domain_init_status =3D 2; mtx_unlock(&dom_mtx);=09 + + callout_reset(&pffast_callout, 1, pffasttimo, NULL); + callout_reset(&pfslow_callout, 1, pfslowtimo, NULL); } =20 struct protosw * --Boundary-01=_jJ8tBMMl+ZnYkYB-- --nextPart1551341.iXytlVmc3k Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQBBt8JuXyyEoT62BG0RAmfoAJ9wdQ8vP1vXWl8xUxMI2xTLvMM9RgCdEsAp 4ZHbOKicXf9vrfQcsXAI1Lg= =ydzf -----END PGP SIGNATURE----- --nextPart1551341.iXytlVmc3k--