protocol timer running before protocol is fully initialized (again) (was re: panic: mtx_lock() of spin mutex ...)

Max Laier max at love2party.net
Wed Dec 8 19:10:58 PST 2004


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 = 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 
SI_SUB_PROTO_DOMAIN, those that are initialized later on (netgraph e.g.) can 
still trigger this prime example why it's bad to hook something in before 
initializing it properly. Unfortunately our code and API force us to do so at 
the moment :-\

Please tell me if the patch (apply to src/sys/kern/uipc_domain.c) helps.

-- 
/"\  Best regards,                      | mlaier at freebsd.org
\ /  Max Laier                          | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | mlaier at EFnet
/ \  ASCII Ribbon Campaign              | Against HTML Mail and News
-------------- next part --------------
A non-text attachment was scrubbed...
Name: uipc_domain.c.lazy.diff
Type: text/x-diff
Size: 788 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20041209/326fdc6f/uipc_domain.c.lazy.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20041209/326fdc6f/attachment.bin


More information about the freebsd-current mailing list