Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Jul 2013 03:31:34 -0700
From:      Craig Rodrigues <rodrigc@FreeBSD.org>
To:        Mikolaj Golub <trociny@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, Adrian Chadd <adrian@freebsd.org>, src-committers@freebsd.org, Marko Zec <zec@fer.hr>
Subject:   Re: svn commit: r253255 - head/sys/netgraph/bluetooth/drivers/ubt
Message-ID:  <CAG=rPVe_F03LTt1K77p1BSw0hojMm-Ms-oZdhaFgo842AxkmhQ@mail.gmail.com>
In-Reply-To: <20130713073118.GC2757@gmail.com>
References:  <201307120803.r6C83ACp016523@svn.freebsd.org> <CAJ-Vmonrmgr3HJRzQtVmWp=8SkpSeWNVeBZgOnSnE72NNp=3DQ@mail.gmail.com> <CAG=rPVcxvWq-MoXADiv%2BgLY-d3hhv1GTMO1R14bhLRm9UB9DqA@mail.gmail.com> <20130712202710.GB2757@gmail.com> <CAJ-Vmomv1nEEq9HV9GreQg6KJGos6ffDhFcVUsUuzfCL6h-YQw@mail.gmail.com> <CAJ-Vmokm29XXbQr5uTwEbGGDYo-8WQNsp60b%2B7Khkteyh%2BO%2B6A@mail.gmail.com> <CAJ-VmomidFufKmGUb0YP2pHWu%2BpF2Os3Fo4JWzkMJDKLqP_ing@mail.gmail.com> <20130713073118.GC2757@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jul 13, 2013 at 12:31 AM, Mikolaj Golub <trociny@freebsd.org> wrote:

>
> Your patch looks similar to Marko's:
>
>
> http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20121115/0824ca85/attachment.diff
>
>
>


> Also, as I understand, after handling vnet context in
> device_probe_and_attach(), there is no need in curvnet setting in
> kldload/kldunload, and Marko removed it.
>

I experimented with Marko's patch, and found that the kernel crashed
inside the code which initializes PF.

(kgdb) where
#0  doadump (textdump=<value optimized out>) at
pcpu.h:234

#1  0xffffffff80923e06 in kern_reboot
(howto=260)

    at
/usr/home/rodrigc/freebsd/9/sys/kern/kern_shutdown.c:449

#2  0xffffffff80924307 in panic (fmt=0x1 <Address 0x1 out of
bounds>)

    at
/usr/home/rodrigc/freebsd/9/sys/kern/kern_shutdown.c:637

#3  0xffffffff80ce9820 in trap_fatal (frame=0xc, eva=<value optimized
out>)

    at
/usr/home/rodrigc/freebsd/9/sys/amd64/amd64/trap.c:879

#4  0xffffffff80ce9b81 in trap_pfault (frame=0xffffff8128845050,
usermode=0)

    at
/usr/home/rodrigc/freebsd/9/sys/amd64/amd64/trap.c:795

#5  0xffffffff80cea134 in trap
(frame=0xffffff8128845050)

    at
/usr/home/rodrigc/freebsd/9/sys/amd64/amd64/trap.c:463

#6  0xffffffff80cd3463 in calltrap () at
/usr/home/rodrigc/freebsd/9/sys/amd64/amd64/exception.S:228

#7  0xffffffff820a0fb4 in init_zone_var
()

    at
/usr/home/rodrigc/freebsd/9/sys/modules/pf/../../contrib/pf/net/pf_ioctl.c:295

#8  0xffffffff820a34db in pf_modevent (mod=<value optimized out>,
type=<value optimized
out>,
    data=<value optimized out>)
    at
/usr/home/rodrigc/freebsd/9/sys/modules/pf/../../contrib/pf/net/pf_ioctl.c:4342
#9  0xffffffff8090ea48 in module_register_init (arg=<value optimized out>)
    at /usr/home/rodrigc/freebsd/9/sys/kern/kern_module.c:123
#10 0xffffffff809069ce in linker_load_module (kldname=<value optimized
out>,
    modname=0xfffffe000730bc00 "pf", parent=0x0, verinfo=0x0,
lfpp=0xffffff8128845958)
    at /usr/home/rodrigc/freebsd/9/sys/kern/kern_linker.c:237
#11 0xffffffff80907008 in kern_kldload (td=0xfffffe0007e10920, file=<value
optimized out>,
---Type <return> to continue, or q <return> to quit---
    fileid=0xffffff81288459b4) at
/usr/home/rodrigc/freebsd/9/sys/kern/kern_linker.c:1031
#12 0xffffffff80907224 in sys_kldload (td=0xfffffe0007e10920, uap=<value
optimized out>)
    at /usr/home/rodrigc/freebsd/9/sys/kern/kern_linker.c:1062
#13 0xffffffff80ce8fca in amd64_syscall (td=0xfffffe0007e10920, traced=0)
at subr_syscall.c:135
#14 0xffffffff80cd3747 in Xfast_syscall ()
    at /usr/home/rodrigc/freebsd/9/sys/amd64/amd64/exception.S:387
#15 0x000000080087e10c in ?? ()

#7  0xffffffff820a0fb4 in init_zone_var ()
    at
/usr/home/rodrigc/freebsd/9/sys/modules/pf/../../contrib/pf/net/pf_ioctl.c:295
295     {
(kgdb) l
290
291             mtx_destroy(&pf_task_mtx);
292     }
293     void
294     init_zone_var(void)
295     {
296             V_pf_src_tree_pl = V_pf_rule_pl = NULL;
297             V_pf_state_pl = V_pf_state_key_pl = V_pf_state_item_pl =
NULL;
298             V_pf_altq_pl = V_pf_pooladdr_pl = NULL;
299             V_pf_frent_pl = V_pf_frag_pl = V_pf_cache_pl = V_pf_cent_pl
= NULL;

In init_zone_var(), curthread->td_vnet was NULL.

So, I don't think it is safe to remove the vnet stuff from
kldload/kldunload just yet,
without fixing some code in some kernel modules like PF.

The other parts of the patch look OK.
--
Craig



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG=rPVe_F03LTt1K77p1BSw0hojMm-Ms-oZdhaFgo842AxkmhQ>