Re: syscons problem in ddb, if_afdata initialization (was: Re: 5.3-BETA3 , panic, probably IPv6+SMP+mpsafenet related)

From: Jan Srzednicki <w_at_expro.pl>
Date: Mon, 6 Sep 2004 17:52:50 +0200
On Sun, Sep 05, 2004 at 01:52:32AM -0400, Robert Watson wrote:
> On Sun, 5 Sep 2004, Sangwoo Shim wrote:
> 
> > I've reported nd6_slowtimo related panic some while ago.  Please check
> > kern/70393.  mlaier_at_ suggested a patch to address this, but that wasn't
> > work for me.  I'll try your patch and report. Thanks. 
> 
> This patch may only fix the problem if running with debug.mpsafenet=0; I'm
> currently exploring the more general if_afdata issues, and will look at
> Max's patch (etc) in the report.  I hope to have a patch that solves it in
> the non-mpsafenet case in a day or two.

Hello,

It appears that a very similar panic (as Robert has figured out, related
to if_afdata not being properly initialized) happens in in6_tmpaddrtimer
function. The important part of the backtrace leading to this is:

#22 0xc065759b in in6_tmpaddrtimer (ignored_arg=0x0)
    at /usr/src/sys/netinet6/in6_ifattach.c:899
        ndi = (struct nd_ifinfo *) 0xc1406280
        nullbuf = "\000\000\000\000\000\000\000"
        ifp = (struct ifnet *) 0xc1405c00
#23 0xc05a364f in softclock (dummy=0x0) at /usr/src/sys/kern/kern_timeout.c:259
        c_func = (void (*)(void *)) 0xc0657520 <in6_tmpaddrtimer>
        c_arg = (void *) 0x0
        c_flags = 6
        c = (struct callout *) 0x0
        bucket = (struct callout_tailq *) 0xcfd00490
        steps = 6
        depth = 1
        mpcalls = 0
        gcalls = 1
        wakeup_cookie = 6
#24 0xc057dcad in ithread_loop (arg=0xc12b9c80)
    at /usr/src/sys/kern/kern_intr.c:546
        ih = (struct intrhand *) 0xc12e0780
        p = (struct proc *) 0xc12e7e00
        count = 0
        warming = 5000
        warned = 0
        __func__ = "ithread_loop"
#25 0xc057cc09 in fork_exit (callout=0xc057dab0 <ithread_loop>, arg=0x0, 
    frame=0x0) at /usr/src/sys/kern/kern_fork.c:820
        p = (struct proc *) 0xc12e7e00
#26 0xc0720dac in fork_trampoline () at /usr/src/sys/i386/i386/exception.s:209
No locals.
(kgdb) select-frame 22
(kgdb) print ifp
$1 = (struct ifnet *) 0xc1405c00
(kgdb) print *ifp
<snip here>
  if_prefixhead = {tqh_first = 0x0, tqh_last = 0xc1405d54}, if_afdata = {
    0x0 <repeats 37 times>}, if_afdata_initialized = 1, if_afdata_mtx = {
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This thing still happens to be not initialized properly, which comes up
again in a different function. So, I guess a similar workaround is
needed here too, until the problem is solved.

That's the workaround for the same (I think) problem that came up in the
nd6_slowtimo() function (by Robert, of course), as it hasn't been posted
on the list yet:

==== //depot/user/rwatson/netperf/sys/netinet6/nd6.c#9 - /home/rwatson/p4/rwatson_netperf/sys/netinet6/nd6.c ====
_at__at_ -1779,6 +1779,8 _at__at_                          
            nd6_slowtimo, NULL);
        IFNET_RLOCK();         
        for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list)) {
+               if (ifp->if_afdata[AF_INET6] == NULL)
+                       continue;
                nd6if = ND_IFINFO(ifp);
                if (nd6if->basereachable && /* already initialized */ 
                    (nd6if->recalctm -= ND6_SLOWTIMER_INTERVAL) <= 0) {

greetings,
-- 
Jan 'Winfried' Srzednicki
w_at_expro.pl
Received on Mon Sep 06 2004 - 13:52:54 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:10 UTC