Bug 243993 - FreeBSD as Guest with 5+ with xnb(4) devices panic on call to sysctl -a in strlen
Summary: FreeBSD as Guest with 5+ with xnb(4) devices panic on call to sysctl -a in s...
Status: Closed DUPLICATE of bug 246307
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.1-STABLE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-xen (Nobody)
URL:
Keywords: panic
Depends on:
Blocks:
 
Reported: 2020-02-08 21:59 UTC by dpd
Modified: 2020-06-03 17:09 UTC (History)
4 users (show)

See Also:


Attachments
Interactive kgdb CLI with VIFs=7 and info, core.txt from savecore. (23.08 KB, application/x-gzip)
2020-02-08 21:59 UTC, dpd
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description dpd 2020-02-08 21:59:47 UTC
Created attachment 211484 [details]
Interactive kgdb CLI with VIFs=7 and info, core.txt from savecore.

When running FreeBSD 12.1-stable r354267 amd64 as a guest under Xen 4.11 (XCP-ng 8.0), when adding 7 VIFs (xn NICs), a `sysctl -a ` panics the VM. 

  XEN: Hypervisor version 4.11 detected.
  Hypervisor: Origin = "XenVMMXenVMM"

It's not totally clear to me why, but it appears that in /usr/src/sys/libkern/strlen.c lines 99 and 100, in strlen(), that lp appears to be zero. 

Burt force testing show that four VIFs using xnb(4) are fine, adding the fifth produces the panic.  

Of note, I also have net.fibs=8, but haven't configured other fibs yet.
Comment 1 Roger Pau Monné freebsd_committer 2020-02-10 11:58:16 UTC
(In reply to dpd from comment #0)
I'm afraid I'm not able to reproduce using Open Source Xen (and the xl tolstack). I've created a guest with 7 vifs, using the following config file:

---
# cat freebsd.cfg
memory=512
vcpus=2
name="freebsd"

type="hvm"

disk = [
  'format=raw,vdev=xvda,access=rw,target=/root/FreeBSD-12.0-CURRENT-amd64.raw',
]

vif = [
 'mac=00:16:3E:74:3d:76,bridge=bridge0',
 'mac=00:16:3E:74:3d:77,bridge=bridge0',
 'mac=00:16:3E:74:3d:78,bridge=bridge0',
 'mac=00:16:3E:74:3d:79,bridge=bridge0',
 'mac=00:16:3E:74:3d:7a,bridge=bridge0,type=vif',
 'mac=00:16:3E:74:3d:7b,bridge=bridge0,type=vif',
 'mac=00:16:3E:74:3d:7c,bridge=bridge0,type=vif',
]

vnc=1
vnclisten="0.0.0.0"

serial='pty'

on_crash="preserve"
---

I've tested with 13.0-CURRENT and 12.1-RELEASE and haven't been able to reproduce using either a FreeBSD or a Linux dom0:

---
root@freebsd:~ # uname -a
FreeBSD freebsd 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC  amd64
root@freebsd:~ # ifconfig -a
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
        inet 127.0.0.1 netmask 0xff000000
        groups: lo
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
xn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=503<RXCSUM,TXCSUM,TSO4,LRO>
        ether 00:16:3e:74:3d:70
        inet6 fe80::216:3eff:fe74:3d70%xn0 prefixlen 64 scopeid 0x2
        inet 10.71.57.46 netmask 0xfffff800 broadcast 10.71.63.255
        media: Ethernet manual
        status: active
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
xn1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=503<RXCSUM,TXCSUM,TSO4,LRO>
        ether 00:16:3e:74:3d:71
        inet6 fe80::216:3eff:fe74:3d71%xn1 prefixlen 64 scopeid 0x3
        inet 10.71.57.156 netmask 0xfffff800 broadcast 10.71.63.255
        media: Ethernet manual
        status: active
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
xn2: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=503<RXCSUM,TXCSUM,TSO4,LRO>
        ether 00:16:3e:74:3d:72
        inet6 fe80::216:3eff:fe74:3d72%xn2 prefixlen 64 scopeid 0x4
        inet 10.71.57.165 netmask 0xfffff800 broadcast 10.71.63.255
        media: Ethernet manual
        status: active
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
xn3: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=503<RXCSUM,TXCSUM,TSO4,LRO>
        ether 00:16:3e:74:3d:73
        inet6 fe80::216:3eff:fe74:3d73%xn3 prefixlen 64 scopeid 0x5
        inet 10.71.57.178 netmask 0xfffff800 broadcast 10.71.63.255
        media: Ethernet manual
        status: active
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
xn4: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=503<RXCSUM,TXCSUM,TSO4,LRO>
        ether 00:16:3e:74:3d:74
        inet6 fe80::216:3eff:fe74:3d74%xn4 prefixlen 64 scopeid 0x6
        inet 10.71.57.184 netmask 0xfffff800 broadcast 10.71.63.255
        media: Ethernet manual
        status: active
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
xn5: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=503<RXCSUM,TXCSUM,TSO4,LRO>
        ether 00:16:3e:74:3d:75
        inet6 fe80::216:3eff:fe74:3d75%xn5 prefixlen 64 scopeid 0x7
        inet 10.71.57.187 netmask 0xfffff800 broadcast 10.71.63.255
        media: Ethernet manual
        status: active
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
xn6: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=503<RXCSUM,TXCSUM,TSO4,LRO>
        ether 00:16:3e:74:3d:76
        inet6 fe80::216:3eff:fe74:3d76%xn6 prefixlen 64 scopeid 0x8
        inet 10.71.57.189 netmask 0xfffff800 broadcast 10.71.63.255
        media: Ethernet manual
        status: active
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
root@freebsd:~ # sysctl -a >/dev/null
root@freebsd:~ # echo $?
0
---

Do you have any custom patches to FreeBSD?

Can you get me an xl config file out of your XCP-ng configuration?

I'm afraid I'm not familiar with XCP-ng, and hence you would have to provide me with a xl config file in order to reproduce and figure out what's going on.
Comment 2 Mark Johnston freebsd_committer 2020-06-03 17:07:25 UTC
I believe this has since been fixed.
Comment 3 Mark Johnston freebsd_committer 2020-06-03 17:09:40 UTC

*** This bug has been marked as a duplicate of bug 246307 ***