Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Dec 2004 04:11:26 +0100
From:      Max Laier <max@love2party.net>
To:        freebsd-current@freebsd.org
Cc:        Steve Kargl <sgk@troutmask.apl.washington.edu>
Subject:   Re: protocol timer running before protocol is fully initialized (again) (was re: panic:  mtx_lock() of spin mutex ...)
Message-ID:  <200412090411.42258.max@love2party.net>
In-Reply-To: <Pine.NEB.3.96L.1041209023008.44319C-100000@fledge.watson.org>
References:  <Pine.NEB.3.96L.1041209023008.44319C-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200412090411.42258.max>