[Bug 219846] [panic] [kevent] mutex nm_kn_lock not owned, netmap with INVARIANTS+WITNESS

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Jun 17 08:27:55 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219846

--- Comment #2 from Harald Schmalzbauer <bugzilla.freebsd at omnilan.de> ---
Like kib@ suggested in
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206053, I already tried to
replacing 1 with 0 in the sys/dev/netmap/netmap_freebsd.c:netmap_kqfilter() at
the call to knlist_add(), which does indeed prevent the initial panic (when the
guest boots), but ends up in another panic short afterwards:

(quoting my github report)

panic: mutex nm_kn_lock owned at
/usr/local/share/deploy-tools/RELENG_11/src/sys/kern/kern_event.c:2176
cpuid = 6
KDB: stack backtrace:
#0 0xffffffff805cb1a7 at kdb_backtrace+0x67
#1 0xffffffff8058b0e6 at vpanic+0x186
#2 0xffffffff8058b163 at panic+0x43
#3 0xffffffff8056c216 at __mtx_assert+0xc6
now:
#4 0xffffffff80545219 at knote+0x39
#5 0xffffffff8041ebc7 at nm_os_selwakeup+0x87
#6 0xffffffff8041c94d at netmap_notify+0x1d
#7 0xffffffff8041c701 at netmap_poll+0x821
#8 0xffffffff8041f63c at netmap_knrw+0x6c
#9 0xffffffff805443d7 at kqueue_kevent+0x397

#10 0xffffffff80543fd6 at kern_kevent_fp+0x96
#11 0xffffffff80543eef at kern_kevent+0x9f
#12 0xffffffff80543cf8 at sys_kevent+0x138
#13 0xffffffff80881b5a at amd64_syscall+0x57a
#14 0xffffffff8086563b at Xfast_syscall+0xfb

#0  doadump (textdump=<value optimized out>) at pcpu.h:222
#1  0xffffffff8058ab60 in kern_reboot (howto=260) at
/usr/local/share/deploy-tools/RELENG_11/src/sys/kern/kern_shutdown.c:366
#2  0xffffffff8058b120 in vpanic (fmt=<value optimized out>, ap=<value
optimized out>)
    at
/usr/local/share/deploy-tools/RELENG_11/src/sys/kern/kern_shutdown.c:759
#3  0xffffffff8058b163 in panic (fmt=<value optimized out>) at
/usr/local/share/deploy-tools/RELENG_11/src/sys/kern/kern_shutdown.c:690
#4  0xffffffff8056c216 in __mtx_assert (c=<value optimized out>,
what=<value optimized out>, file=<value optimized out>, line=<value
optimized out>)
    at
/usr/local/share/deploy-tools/RELENG_11/src/sys/kern/kern_mutex.c:1013
#5  0xffffffff80545219 in knote (list=<value optimized out>, hint=256,
lockflags=0) at
/usr/local/share/deploy-tools/RELENG_11/src/sys/kern/kern_event.c:2034
#6  0xffffffff8041ebc7 in nm_os_selwakeup (si=0xfffffe00088b94c0) at
/usr/local/share/deploy-tools/RELENG_11/src/sys/dev/netmap/netmap_freebsd.c:1259
#7  0xffffffff8041c94d in netmap_notify (kring=<value optimized out>,
flags=<value optimized out>)
    at
/usr/local/share/deploy-tools/RELENG_11/src/sys/dev/netmap/netmap.c:2777
#8  0xffffffff8041c701 in netmap_poll (priv=<value optimized out>,
events=<value optimized out>, sr=0x0)
    at
/usr/local/share/deploy-tools/RELENG_11/src/sys/dev/netmap/netmap.c:2735
#9  0xffffffff8041f63c in netmap_knrw (kn=<value optimized out>,
hint=<value optimized out>, events=1)
    at
/usr/local/share/deploy-tools/RELENG_11/src/sys/dev/netmap/netmap_freebsd.c:1313
#10 0xffffffff805443d7 in kqueue_kevent (kq=0xfffff8001aa08600,
td=0xfffff80141470560, nchanges=<value optimized out>, nevents=<value
optimized out>,
    k_ops=0xfffffe045b5028a0, timeout=<value optimized out>) at
/usr/local/share/deploy-tools/RELENG_11/src/sys/kern/kern_event.c:1700
#11 0xffffffff80543fd6 in kern_kevent_fp (td=0xfffff80141470560,
fp=<value optimized out>, nchanges=0, nevents=<value optimized out>,
    k_ops=<value optimized out>, timeout=<value optimized out>) at
/usr/local/share/deploy-tools/RELENG_11/src/sys/kern/kern_event.c:1050
#12 0xffffffff80543eef in kern_kevent (td=0xfffff80141470560, fd=6,
nchanges=0, nevents=64, k_ops=0xfffffe045b5028a0, timeout=0x0)
    at /usr/local/share/deploy-tools/RELENG_11/src/sys/kern/kern_event.c:993
#13 0xffffffff80543cf8 in sys_kevent (td=0xfffff80141470560,
uap=0xfffffe045b502a30) at
/usr/local/share/deploy-tools/RELENG_11/src/sys/kern/kern_event.c:925
#14 0xffffffff80881b5a in amd64_syscall (td=0xfffff80141470560,
traced=0) at subr_syscall.c:135
#15 0xffffffff8086563b in Xfast_syscall () at
/usr/local/share/deploy-tools/RELENG_11/src/sys/amd64/amd64/exception.S:396
#16 0x000000080122813a in ?? ()

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list