Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 09 Oct 2023 13:55:17 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 274375] page fault while load kernel module virtio
Message-ID:  <bug-274375-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D274375

            Bug ID: 274375
           Summary: page fault while load kernel module virtio
           Product: Base System
           Version: 15.0-CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: zlei@FreeBSD.org

This is initially observed while checking sysctl knobs (loader tunables) in
modules.
I managed to narrow it down.

Tested with current/15 and 14.0-BETA5 on amd64 machine.

Steps to repeat:

```
# kldload sdt
# kldload virtio.ko
```

The kernel backtrace:

```
 dumped core - see /var/crash/vmcore.3

Sun Oct  8 10:25:33 CST 2023

FreeBSD  14.0-BETA5 FreeBSD 14.0-BETA5 #1 releng/14.0-n265192-d67558ef3149:=
 Sat
Oct  7 18:03:25 CST 2023=20=20=20=20
zlei@:/usr/obj/home/zlei/freebsd-src-releng-14.0/amd64.amd64/sys/GENERIC  a=
md64

panic: page fault

GNU gdb (GDB) 13.2 [GDB v13.2 for FreeBSD]
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.htm=
l>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-portbld-freebsd14.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /boot/kernel/kernel...
Reading symbols from /usr/lib/debug//boot/kernel.beta5/kernel.debug...
interface virtio.1 already present in the KLD 'kernel'!


Fatal trap 12: page fault while in kernel mode
cpuid =3D 1; apic id =3D 02
fault virtual address   =3D 0x0
fault code              =3D supervisor read data, page not present
instruction pointer     =3D 0x20:0xffffffff8321b134
stack pointer           =3D 0x28:0xfffffe00b04e7920
frame pointer           =3D 0x28:0xfffffe00b04e7950
code segment            =3D base 0x0, limit 0xfffff, type 0x1b
                        =3D DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags        =3D interrupt enabled, resume, IOPL =3D 0
current process         =3D 97755 (kldload)
rdi: fffff80178d6a6a0 rsi: fffffe00b04e7928 rdx: 0000000000000000
rcx: ffffffff88ff5470  r8: 0000000000000004  r9: 00000000000000f3
rax: 0000000000000000 rbx: fffffe00b04e7974 rbp: fffffe00b04e7950
r10: 0000000000000002 r11: ffffffffffffff90 r12: fffff80178bfd780
r13: fffffe00b04e7974 r14: fffff80178bfd7c0 r15: ffffffff88ff5468
trap number             =3D 12
panic: page fault
cpuid =3D 1
time =3D 1696731847
KDB: stack backtrace:
#0 0xffffffff80b9017d at kdb_backtrace+0x5d
#1 0xffffffff80b43282 at vpanic+0x132
#2 0xffffffff80b43143 at panic+0x43
#3 0xffffffff8100b81c at trap_fatal+0x40c
#4 0xffffffff8100b86f at trap_pfault+0x4f
#5 0xffffffff80fe2848 at calltrap+0x8
#6 0xffffffff80b0f61c at linker_file_unload+0xcc
#7 0xffffffff810be9c8 at link_elf_load_file+0x198
#8 0xffffffff80b0ee93 at linker_load_module+0x9e3
#9 0xffffffff80b10b9a at kern_kldload+0x16a
#10 0xffffffff80b10cbc at sys_kldload+0x5c
#11 0xffffffff8100c0d9 at amd64_syscall+0x109
#12 0xffffffff80fe315b at fast_syscall_common+0xf8
Uptime: 16m43s
Dumping 727 out of 8100 MB:..3%..11%..22%..31%..42%..51%..62%..71%..82%..91%

__curthread ()
    at /home/zlei/freebsd-src-releng-14.0/sys/amd64/include/pcpu_aux.h:57
57              __asm("movq %%gs:%P1,%0" : "=3Dr" (td) : "n" (offsetof(stru=
ct
pcpu,
(kgdb) #0  __curthread ()
    at /home/zlei/freebsd-src-releng-14.0/sys/amd64/include/pcpu_aux.h:57
#1  doadump (textdump=3D<optimized out>)
    at /home/zlei/freebsd-src-releng-14.0/sys/kern/kern_shutdown.c:405
#2  0xffffffff80b42e17 in kern_reboot (howto=3D260)
    at /home/zlei/freebsd-src-releng-14.0/sys/kern/kern_shutdown.c:526
#3  0xffffffff80b432ef in vpanic (fmt=3D0xffffffff81135a78 "%s",=20
    ap=3Dap@entry=3D0xfffffe00b04e7770)
    at /home/zlei/freebsd-src-releng-14.0/sys/kern/kern_shutdown.c:970
#4  0xffffffff80b43143 in panic (fmt=3D<unavailable>)
    at /home/zlei/freebsd-src-releng-14.0/sys/kern/kern_shutdown.c:894
#5  0xffffffff8100b81c in trap_fatal (frame=3D0xfffffe00b04e7860, eva=3D0)
    at /home/zlei/freebsd-src-releng-14.0/sys/amd64/amd64/trap.c:952
#6  0xffffffff8100b86f in trap_pfault (frame=3D0xfffffe00b04e7860,=20
    usermode=3Dfalse, signo=3D<optimized out>, ucode=3D<optimized out>)
    at /home/zlei/freebsd-src-releng-14.0/sys/amd64/amd64/trap.c:760
#7  <signal handler called>
#8  0xffffffff8321b134 in sdt_kld_unload_try () from /boot/kernel/sdt.ko
#9  0xffffffff80b0f61c in linker_file_unload (file=3D0xfffffe00b04e7974,=20
    file@entry=3D0xfffff8015497b480, flags=3Dflags@entry=3D1)
    at /home/zlei/freebsd-src-releng-14.0/sys/kern/kern_linker.c:673
#10 0xffffffff810be9c8 in link_elf_load_file (cls=3D<optimized out>,=20
    filename=3D<optimized out>, result=3D<optimized out>)
    at /home/zlei/freebsd-src-releng-14.0/sys/kern/link_elf_obj.c:1241
#11 0xffffffff80b0ee93 in LINKER_LOAD_FILE (
    cls=3D0xffffffff817550a8 <link_elf_class>, result=3D0xfffffe00b04e7c00,=
=20
    filename=3D<optimized out>) at ./linker_if.h:214
#12 linker_load_file (filename=3D<optimized out>, result=3D<optimized out>)
    at /home/zlei/freebsd-src-releng-14.0/sys/kern/kern_linker.c:459
#13 linker_load_module (kldname=3Dkldname@entry=3D0xfffff80154965800 "virti=
o.ko",=20
    modname=3Dmodname@entry=3D0x0, parent=3Dparent@entry=3D0x0,=20
    verinfo=3Dverinfo@entry=3D0x0, lfpp=3Dlfpp@entry=3D0xfffffe00b04e7d90)
    at /home/zlei/freebsd-src-releng-14.0/sys/kern/kern_linker.c:2203
#14 0xffffffff80b10b9a in kern_kldload (td=3Dtd@entry=3D0xfffffe00b0d3a3a0,=
=20
    file=3Dfile@entry=3D0xfffff80154965800 "virtio.ko",=20
    fileid=3Dfileid@entry=3D0xfffffe00b04e7de4)
    at /home/zlei/freebsd-src-releng-14.0/sys/kern/kern_linker.c:1162
#15 0xffffffff80b10cbc in sys_kldload (td=3D0xfffffe00b0d3a3a0,=20
    uap=3D<optimized out>)
    at /home/zlei/freebsd-src-releng-14.0/sys/kern/kern_linker.c:1185
#16 0xffffffff8100c0d9 in syscallenter (td=3D0xfffffe00b0d3a3a0)
    at
/home/zlei/freebsd-src-releng-14.0/sys/amd64/amd64/../../kern/subr_syscall.=
c:187
#17 amd64_syscall (td=3D0xfffffe00b0d3a3a0, traced=3D0)
    at /home/zlei/freebsd-src-releng-14.0/sys/amd64/amd64/trap.c:1197
#18 <signal handler called>
#19 0x000013e93dad93fa in ?? ()
Backtrace stopped: Cannot access memory at address 0x13e93c3e81c8
(kgdb)=20
```

Note: `kldload virtio.ko` can trigger the panic but `kldload virtio` will n=
ot.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-274375-227>