Bug 264842 - kernel core generated due to VM page fault
Summary: kernel core generated due to VM page fault
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.4-RELEASE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: crash, panic
Depends on:
Blocks:
 
Reported: 2022-06-23 10:49 UTC by aadhya
Modified: 2022-06-25 13:04 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description aadhya 2022-06-23 10:49:36 UTC
We have observed core generated several times due to page fault.

Environment :
===================
hw.model: Intel(R) Xeon(R) Gold 5118 CPU @ 2.30GHz
hw.machine: amd64
hw.ncpu: 24
FreeBSD 11.2-RELEASE

Here is the BT :
==================
(kgdb) bt
#0  0xffffffff806110e7 in doadump ()
#1  0xffffffff80610f5b in kern_reboot ()
#2  0xffffffff80611459 in vpanic ()
#3  0xffffffff80611193 in panic ()
#4  0xffffffff808967df in trap_fatal ()
#5  0xffffffff80896839 in trap_pfault ()
#6  0xffffffff80896028 in trap ()
#7  0xffffffff8087535e in calltrap ()
#8  0xffffffff8085c9b1 in vm_page_alloc_after ()
#9  0xffffffff8085f450 in vm_page_grab_pages ()
#10 0xffffffff806aa6aa in allocbuf ()
#11 0xffffffff806a8a99 in getblk ()
#12 0xffffffff80801b4f in ffs_balloc_ufs2 ()
#13 0xffffffff8082b39b in ffs_write ()
#14 0xffffffff80950dc3 in VOP_WRITE_APV ()
#15 0xffffffff806da6e4 in vn_write ()
#16 0xffffffff806da223 in vn_io_fault_doio ()
#17 0xffffffff806d82a1 in vn_io_fault1 ()
#18 0xffffffff806d6518 in vn_io_fault ()
#19 0xffffffff8066b330 in dofilewrite ()
#20 0xffffffff8066af48 in kern_writev ()
#21 0xffffffff8066aed6 in sys_write ()
#22 0xfffffe103e0271e0 in ?? ()
#23 0xffffffff00000001 in ?? ()
#24 0x0000000000130000 in ?? ()
#25 0x0000000000010000 in ?? ()
#26 0x0000000100000000 in ?? ()
#27 0xfffff80012f3d620 in ?? ()
#28 0x00000008139dc000 in ?? ()
#29 0x0000000000010000 in ?? ()
#30 0xfffffe103e027330 in ?? ()
#31 0xffffffff80896f3c in amd64_syscall ()
(kgdb) 

=================================================

After adding symbol file the bt gives the following details :

(kgdb) bt
#0  doadump (textdump=1) at pcpu.h:229
#1  0xffffffff80610f5b in kern_reboot (howto=260) at ../../../kern/kern_shutdown.c:395
#2  0xffffffff80611459 in vpanic (fmt=<value optimized out>, ap=<value optimized out>)
    at ../../../kern/kern_shutdown.c:799
#3  0xffffffff80611193 in panic (fmt=<value optimized out>) at ../../../kern/kern_shutdown.c:719
#4  0xffffffff808967df in trap_fatal (frame=0xfffffe103e026890, eva=90) at ../../../amd64/amd64/trap.c:875
#5  0xffffffff80896839 in trap_pfault (frame=0xfffffe103e026890, usermode=0) at pcpu.h:229
#6  0xffffffff80896028 in trap (frame=0xfffffe103e026890) at ../../../amd64/amd64/trap.c:415
#7  0xffffffff8087535e in calltrap () at ../../../amd64/amd64/exception.S:196
#8  0xffffffff8085c9b1 in vm_page_alloc_after (object=0xfffff80297ab42d0, pindex=307, req=<value optimized out>,
    mpred=0xfffff8103310e3d8) at atomic.h:219
#9  0xffffffff8085f450 in vm_page_grab_pages (object=<value optimized out>, pindex=304,
    allocflags=<value optimized out>, ma=0xfffffe0f81090bc0, count=<value optimized out>) at ../../../vm/vm_page.c:3397
#10 0xffffffff806aa6aa in allocbuf (bp=0xfffffe0f81090ac0, size=<value optimized out>) at ../../../kern/vfs_bio.c:2759
#11 0xffffffff806a8a99 in getblk (vp=<value optimized out>, blkno=<value optimized out>, size=<value optimized out>,
    slpflag=<value optimized out>, slptimeo=<value optimized out>, flags=8) at ../../../kern/vfs_bio.c:3769
#12 0xffffffff80801b4f in ffs_balloc_ufs2 (vp=0xfffff8041e470760, startoffset=<value optimized out>,
    size=<value optimized out>, cred=0xfffff80020140700, flags=<value optimized out>, bpp=0xfffffe103e026d28)
    at ../../../ufs/ffs/ffs_balloc.c:1001
#13 0xffffffff8082b39b in ffs_write (ap=0xfffffe103e026e88) at ../../../ufs/ffs/ffs_vnops.c:749
#14 0xffffffff80950dc3 in VOP_WRITE_APV (vop=<value optimized out>, a=0xfffffe103e026e88) at vnode_if.c:1000
#15 0xffffffff806da6e4 in vn_write (fp=<value optimized out>, uio=<value optimized out>, active_cred=0x130000,
    flags=<value optimized out>, td=<value optimized out>) at vnode_if.h:413
#16 0xffffffff806da223 in vn_io_fault_doio (args=0xfffffe103e0270a0, uio=0xfffffe103e0271b0, td=0xfffff80012f3d620)
    at ../../../kern/vfs_vnops.c:965
#17 0xffffffff806d82a1 in vn_io_fault1 () at ../../../kern/vfs_vnops.c:1083
#18 0xffffffff806d6518 in vn_io_fault (fp=<value optimized out>, uio=0xfffff8041e4708e8,
    active_cred=0xfffff80020250078, flags=<value optimized out>, td=<value optimized out>)
    at ../../../kern/vfs_vnops.c:1187
#19 0xffffffff8066b330 in dofilewrite (td=0xfffff80012f3d620, fd=91, fp=0xfffff802151c5b40, auio=0xfffffe103e0271b0,
    offset=<value optimized out>, flags=0) at file.h:307
#20 0xffffffff8066af48 in kern_writev (td=0xfffff80012f3d620, fd=91, auio=0xfffffe103e0271b0)
---Type <return> to continue, or q <return> to quit---
    at ../../../kern/sys_generic.c:506
#21 0xffffffff8066aed6 in sys_write (td=<value optimized out>, uap=<value optimized out>)
    at ../../../kern/sys_generic.c:420
#22 0xffffffff80896f3c in amd64_syscall (td=0xfffff80012f3d620, traced=0) at subr_syscall.c:132
#23 0xffffffff80875bad in fast_syscall_common () at ../../../amd64/amd64/exception.S:475
#24 0x0000000801ef5e8a in ?? ()
Previous frame inner to this frame (corrupt stack?)
(kgdb)

================================================

What could be the possible fix for this crash ?
Thanks !!!
Comment 1 Kurt Jaeger freebsd_committer 2022-06-23 11:05:58 UTC
amd64 != arm, so reassigning.

Is it possible to upgrade to a recent version of FreeBSD to see if newer
version fix the problem ?
Comment 2 aadhya 2022-06-23 11:17:42 UTC
Hi,
Direct upgrade to recent version may not be possible, applying patch would be best solution for us. I will check if this issue has been reported for latest version of FreeBSD. 

Is there any existing patch for this issue ?

Thanks.
Comment 3 Kurt Jaeger freebsd_committer 2022-06-23 11:31:25 UTC
(In reply to aadhya from comment #2)
a simple

freebsd-update -r 12.2-RELEASE upgrade
freebsd-update install
shutdown -r now
freebsd-update install

should work fine to upgrade to 12.2, if this is stock FreeBSD 11.2-REL.
Comment 4 Kurt Jaeger freebsd_committer 2022-06-23 11:32:50 UTC
(In reply to aadhya from comment #2)
I have no idea if there's a patch for it. But: The oldest still supported
version is 12.3, so please do not expect that someone will dig into an issue for 11.2.
Comment 5 Graham Perrin 2022-06-25 13:04:41 UTC
(In reply to aadhya from comment #2)

> Direct upgrade to recent version may not be possible, …

May I ask why? 

If you prefer a more cautious approach, you can step from 11.2 to 11.3 then 11.4 before the major upgrade to supported versions 12.3 or 13.1. 

<https://www.freebsd.org/releases/11.3R/installation/#upgrade-binary>
<https://www.freebsd.org/releases/11.4R/installation/#upgrade-binary>

<https://www.freebsd.org/releases/12.3R/installation/#upgrade-binary>

<https://www.freebsd.org/releases/13.1R/installation/#upgrade-binary>
<https://www.freebsd.org/releases/13.1R/relnotes/#upgrade> note the warning about sshd.