It looks like the IPv4 multicast code has not been fully converted to
use epochs. I installed this week's snapshot of -current, configured
and started mrouted, and started rwhod -m. The system crashed shortly
thereafter with this:
panic: Assertion in_epoch(net_epoch_preempt) failed at
/usr/src/sys/netinet/ip_output.c:343
cpuid = 15
time = 1647609865
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfe01b51a39d0
vpanic() at vpanic+0x17f/frame 0xfe01b51a3a20
panic() at panic+0x43/frame 0xfe01b51a3a80
ip_output() at ip_output+0x15f9/frame 0xfe01b51a3b80
phyint_send() at phyint_send+0x107/frame 0xfe01b51a3be0
ip_mdq() at ip_mdq+0x259/frame 0xfe01b51a3c60
X_ip_mrouter_set() at X_ip_mrouter_set+0x9e4/frame 0xfe01b51a3d30
sosetopt() at sosetopt+0xee/frame 0xfe01b51a3d80
kern_setsockopt() at kern_setsockopt+0xad/frame 0xfe01b51a3de0
sys_setsockopt() at sys_setsockopt+0x24/frame 0xfe01b51a3e00
amd64_syscall() at amd64_syscall+0x12e/frame 0xfe01b51a3f30
fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfe01b51a3f30
--- syscall (105, FreeBSD ELF64, sys_setsockopt), rip = 0x821b72dda, rsp =
0x8204c06f8, rbp = 0x8204c0750 ---
KDB: enter: panic
The kgdb backtrace is appended.
It looks like ip_mroute is protected in the forwarding path (it's called
from ip_input) and the output path, but not in the setup path from
setsockopt(). At least the MRT_ADD_MFC call needs to enter an epoch.
I tried adding epoch handling in add_mfc(), and that seems to work.
The alternative would be to do it in Xip_mrouter_set() so it would cover
all the calls. Any opinions?
Mike
(kgdb) bt
#0 __curthread () at /usr/src/sys/amd64/include/pcpu_aux.h:55
#1 doadump (textdump=textdump@entry=1)
at /usr/src/sys/kern/kern_shutdown.c:406
#2 0x80c0b8ed in kern_reboot (howto=260)
at /usr/src/sys/kern/kern_shutdown.c:527
#3 0x80c0bdfe in vpanic (
fmt=0x8120c2ec "Assertion %s failed at %s:%d", ap=)
at /usr/src/sys/kern/kern_shutdown.c:965
#4 0x80c0bb53 in panic (fmt=)
at /usr/src/sys/kern/kern_shutdown.c:889
#5 0x80dde8f9 in ip_output (m=m@entry=0xf802de8cb000,
opt=opt@entry=0x0, ro=ro@entry=0x0, flags=flags@entry=1,
imo=imo@entry=0xfe01b51a3b98, inp=inp@entry=0x0)
at /usr/src/sys/netinet/ip_output.c:343
#6 0x82847317 in send_packet (vifp=0xf801c862,
m=) at /usr/src/sys/netinet/ip_mroute.c:1768
#7 phyint_send (ip=ip@entry=0xf8000ff1fc68, vifp=0xf801c862,
m=, m@entry=0xf8000ff1fc00)
at /usr/src/sys/netinet/ip_mroute.c:1745
#8 0x828465c9 in ip_mdq (m=0xf8000ff1fc00, ifp=,
rt=rt@entry=0xf80025175b00, xmt_vif=xmt_vif@entry=65535)
at /usr/src/sys/netinet/ip_mroute.c:1653
#9 0x82844924 in add_mfc (mfccp=0xfe01b51a3ca0)
at /usr/src/sys/netinet/ip_mroute.c:1168
#10 X_ip_mrouter_set (so=,
so@entry=,
sopt=,
sopt@entry=)
at /usr/src/sys/netinet/ip_mroute.c:469
#11 0x80cbbafe in sosetopt (so=0xf8000fb1d3c0,