[Bug 283815] 'sysctl -a' hangs indefinitely

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 03 Jan 2025 13:09:38 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=283815

            Bug ID: 283815
           Summary: 'sysctl -a' hangs indefinitely
           Product: Base System
           Version: 14.2-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: vsasjason@gmail.com

Created attachment 256370
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=256370&action=edit
/var/run/dmesg.boot (verbose)

After upgrading to 14.2R from 14.1R, I noticed that listing all sysctls doesn't
work anymore. It stops here:
<CUT>
dev.ahci.%parent:
dev.vgapci.1.%iommu: rid=0x10
dev.vgapci.1.%parent: pci0
dev.vgapci.1.%pnpinfo: vendor=0x8086 device=0x591b subvendor=0x1028
subdevice=0x07b1 class=0x030000
dev.vgapci.1.%location: slot=2 function=0 dbsf=pci0:0:2:0
handle=\_SB_.PCI0.GFX0
dev.vgapci.1.%driver: vgapci
dev.vgapci.1.%desc: VGA-compatible display
dev.vgapci.0.wake: 0
^C^C^C

Process enters R+, eats 100% CPU and becomes unkillable:
jason@jnb: [?:0] ~ $ ps auwwx | grep '[s]ysctl'
jason        25384 100.0  0.0   16888   4880  6  R+   15:00    0:49.15 sysctl
-a
jason@jnb: [?:0] ~ $ kill -9 25384
jason@jnb: [?:0] ~ $ ps auwwx | grep '[s]ysctl'
jason        25384 100.0  0.0   16888   4880  6  R+   15:00    3:19.35 sysctl
-a
jason@jnb: [?:0] ~ $ procstat -kk 25384
  PID    TID COMM                TDNAME              KSTACK
25384 101712 sysctl              -                   pci_find_cap_method+0x11a
iommu_get_requester+0x192 device_sysctl_handler+0x216
sysctl_root_handler_locked+0x8a sysctl_root+0x1fa userland_sysctl+0x115
sys___sysctl+0x60 amd64_syscall+0xed fast_syscall_common+0xf8

In this state, subsequent 'sysctl kern.geom' works fine, while 'sysctl dev.cpu'
also hangs:
jason@jnb: [?:0] ~ $ ps auwwx | grep '[s]ysctl'
jason        25436 100.0  0.0   13816   2236  5  R+   15:05    1:30.48 sysctl
dev.cpu
jason        25384 100.0  0.0   16888   4880  6  R+   15:00    6:31.35 sysctl
-a
jason@jnb: [?:0] ~ $ procstat -kk 25436 25384
  PID    TID COMM                TDNAME              KSTACK
25436 101172 sysctl              -                  
sysctl_root_handler_locked+0x143 sysctl_root+0x1fa userland_sysctl+0x115
sys___sysctl+0x60 amd64_syscall+0xed fast_syscall_common+0xf8
25384 101712 sysctl              -                   pci_find_cap_method+0x17a
iommu_get_requester+0x192 device_sysctl_handler+0x216
sysctl_root_handler_locked+0x8a sysctl_root+0x1fa userland_sysctl+0x115
sys___sysctl+0x60 amd64_syscall+0xed fast_syscall_common+0xf8
jason@jnb: [?:0] ~ $

No changes have been made to system configuration during upgrade.

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