Bug 282533 - 14.2-STABLE Panic after executing procstat on a process using netmap
Summary: 14.2-STABLE Panic after executing procstat on a process using netmap
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 14.2-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: Konstantin Belousov
URL:
Keywords: crash
Depends on:
Blocks:
 
Reported: 2024-11-04 09:09 UTC by Sylvain Galliano
Modified: 2024-11-13 18:10 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sylvain Galliano 2024-11-04 09:09:55 UTC
After using a netmap process (i.e bridge) and executing 'procstat -v <bridge-pid>' I got the following panic:

panic: page fault
cpuid = 6
time = 1730707662
KDB: stack backtrace:
#0 0xffffffff80b1f46d at kdb_backtrace+0x5d
#1 0xffffffff80ad6e61 at vpanic+0x131
#2 0xffffffff80ad6d23 at panic+0x43
#3 0xffffffff81001a7b at trap_fatal+0x40b
#4 0xffffffff81001ac6 at trap_pfault+0x46
#5 0xffffffff80fd8f3e at calltrap+0x8
#6 0xffffffff80b360c8 at propagate_priority+0x58
#7 0xffffffff80b36a41 at turnstile_wait+0x2a1
#8 0xffffffff80ab6830 at __mtx_lock_sleep+0x120
#9 0xffffffff80a7065a at dev_refthread+0x8a
#10 0xffffffff80abed73 at kern_proc_vmmap_out+0x313
#11 0xffffffff80ac0f5d at sysctl_kern_proc_vmmap+0x7d
#12 0xffffffff80ae6f14 at sysctl_root_handler_locked+0x84
#13 0xffffffff80ae6396 at sysctl_root+0x216
#14 0xffffffff80ae69d1 at userland_sysctl+0x151
#15 0xffffffff80ae6840 at sys___sysctl+0x60
#16 0xffffffff810022ba at amd64_syscall+0xda
#17 0xffffffff80fd985b at fast_syscall_common+0xf8

Issue start since commit cdc72c4960656d581fd566425de7bfa50b3ef654
After reverting it I have no more panic.
Comment 1 Marek Zarychta 2024-11-04 09:33:28 UTC
This is an interesting report, though I cannot reproduce it. While running net-mgmt/fastnetmon using netmap(4) mode in a jail, the procstat(1) command works as intended.
Comment 2 Sylvain Galliano 2024-11-04 12:59:14 UTC
(In reply to Marek Zarychta from comment #1)
Indeed, I cannot reproduce panic when process is running into a jail.
I also get a panic using 14.2-BETA1
Comment 3 Konstantin Belousov freebsd_committer freebsd_triage 2024-11-04 13:08:34 UTC
Can you get the vmcore from the panic?
Comment 4 Sylvain Galliano 2024-11-04 14:42:57 UTC
(In reply to Konstantin Belousov from comment #3)

Here it is, full /boot/kernel (GENERIC-DEBUG) and /var/crash/vmcore file:

https://drive.google.com/file/d/10SIvm6h1Z2YLPV5CCKxEh0ljtAuKizJr/view?usp=drive_link
Comment 5 Konstantin Belousov freebsd_committer freebsd_triage 2024-11-04 20:23:29 UTC
You posted kernel and vmcore, but not debugging symbols, which makes the archive
not useful.

Please either give me the kernel.full file exactly as was used to generate both
kernel and vmcore from your archive, or I will ask you for the series of commands
to execute in kgdb on your system with the core.
Comment 6 Sylvain Galliano 2024-11-04 20:47:56 UTC
(In reply to Konstantin Belousov from comment #5)
Archive file with full content of /usr/lib/debug/boot/kernel

https://drive.google.com/file/d/1zCfGbm8w48ngWRx8w3qRGzwdtRh4ai70/view?usp=drive_link
Comment 7 Konstantin Belousov freebsd_committer freebsd_triage 2024-11-04 22:24:19 UTC
https://reviews.freebsd.org/D47443
Comment 8 commit-hook freebsd_committer freebsd_triage 2024-11-06 00:24:28 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=580340dbdaaf372867e9ed3dd257430982753e5e

commit 580340dbdaaf372867e9ed3dd257430982753e5e
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-11-04 21:54:30 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-11-06 00:11:00 +0000

    vm_object: do not assume that un_pager.devp.dev is cdev

    It is subtype-specific handle.  Mark OBJT_DEVICE that do fill cdev into
    the handle, with a new object flag OBJ_CDEVH.

    PR:     282533
    Reviewed by:    markj
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D47443

 sys/kern/kern_proc.c | 5 +++--
 sys/vm/vm_mmap.c     | 3 +++
 sys/vm/vm_object.c   | 3 ++-
 sys/vm/vm_object.h   | 1 +
 4 files changed, 9 insertions(+), 3 deletions(-)
Comment 9 commit-hook freebsd_committer freebsd_triage 2024-11-12 23:19:57 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=92a9501b6be3d37a4eefcfbdda799b656ae146e8

commit 92a9501b6be3d37a4eefcfbdda799b656ae146e8
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-11-04 21:54:30 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-11-12 23:19:18 +0000

    vm_object: do not assume that un_pager.devp.dev is cdev

    PR:     282533

    (cherry picked from commit 580340dbdaaf372867e9ed3dd257430982753e5e)

 sys/kern/kern_proc.c | 5 +++--
 sys/vm/vm_mmap.c     | 3 +++
 sys/vm/vm_object.c   | 3 ++-
 sys/vm/vm_object.h   | 1 +
 4 files changed, 9 insertions(+), 3 deletions(-)
Comment 10 commit-hook freebsd_committer freebsd_triage 2024-11-13 18:07:32 UTC
A commit in branch releng/14.2 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=19d23cb8acc934a9bb5ca46375da4cc5c4d2094c

commit 19d23cb8acc934a9bb5ca46375da4cc5c4d2094c
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-11-04 21:54:30 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-11-13 18:06:36 +0000

    vm_object: do not assume that un_pager.devp.dev is cdev

    PR:     282533
    Approved by:    re (cperciva)

    (cherry picked from commit 580340dbdaaf372867e9ed3dd257430982753e5e)
    (cherry picked from commit 92a9501b6be3d37a4eefcfbdda799b656ae146e8)

 sys/kern/kern_proc.c | 5 +++--
 sys/vm/vm_mmap.c     | 3 +++
 sys/vm/vm_object.c   | 3 ++-
 sys/vm/vm_object.h   | 1 +
 4 files changed, 9 insertions(+), 3 deletions(-)