Bug 263219 - Kernel Panics when doing IO on USB3 device
Summary: Kernel Panics when doing IO on USB3 device
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: 12.3-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-usb (Nobody)
URL:
Keywords: crash
Depends on:
Blocks:
 
Reported: 2022-04-11 12:38 UTC by Luciano Mannucci
Modified: 2022-10-12 00:49 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luciano Mannucci 2022-04-11 12:38:57 UTC
When writing to a hard disc accessed via USB3 I get a panic and a kernel coredump. I've recompiled my GENERIC Kernel with debug; uname -a says

FreeBSD mordax 12.3-RELEASE-p5 FreeBSD 12.3-RELEASE-p5 GENERIC  amd64

dmesg says:

#14 0xffffffff80cafa03 at reassignbuf+0x73
#15 0xffffffff80c90639 at bdirty+0x39
#16 0xffffffff80c8f80d at brelse+0x10d
#17 0xffffffff80c920e0 at bufdone+0x2d0
WARN_ON(!mutex_is_locked(&dev->struct_mutex))
                        
WARN_ON(!mutex_is_locked(&fbc->lock))
   
WARN_ON(!mutex_is_locked(&fbc->lock))WARN_ON(!mutex_is_locked(&fbc->lock))WARN_ON(!mutex_is_locked(&fbc->lock))
panic: pctrie_remove: impossible to locate the key
cpuid = 3
time = 1649598985
KDB: stack backtrace:
#0 0xffffffff80c2d4a5 at kdb_backtrace+0x65
#1 0xffffffff80be163b at vpanic+0x17b
#2 0xffffffff80be14b3 at panic+0x43
#3 0xffffffff80c3152e at pctrie_remove+0x1ae
#4 0xffffffff80cafa03 at reassignbuf+0x73
#5 0xffffffff80c90639 at bdirty+0x39
#6 0xffffffff80c8f80d at brelse+0x10d
#7 0xffffffff80c920e0 at bufdone+0x2d0
#8 0xffffffff80b2db2b at g_io_deliver+0x1eb
#9 0xffffffff80b2db2b at g_io_deliver+0x1eb
#10 0xffffffff80b2aab2 at g_disk_done+0x102
#11 0xffffffff80c2665e at bioq_flush+0x7e
#12 0xffffffff80382698 at cam_iosched_flush+0x18
#13 0xffffffff803bcdab at dadone+0x15b
#14 0xffffffff8038cd77 at xpt_done_process+0x407
#15 0xffffffff8038f035 at xpt_done_td+0xf5
#16 0xffffffff80ba2a0e at fork_exit+0x7e
#17 0xffffffff810d61de at fork_trampoline+0xe
Uptime: 17h33m36s
Dumping 837 out of 8023 MB:..2%..12%..22%..31%..41%..52%..62%..71%..81%..92%---<<BOOT>>---

issueing
kgdb /usr/lib/debug/boot/kernel/kernel.debug /var/crash/vmcore.0

I get:

GNU gdb (GDB) 11.2 [GDB v11.2 for FreeBSD]
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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-freebsd12.2".
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 /usr/lib/debug/boot/kernel/kernel.debug...

Unread portion of the kernel message buffer:
(da0:umass-sim0:0:0:0): READ(10). CDB: 28 00 04 f2 84 e8 00 00 80 00 
(da0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(da0:umass-sim0:0:0:0): SCSI status: Check Condition
(da0:umass-sim0:0:0:0): SCSI sense: MEDIUM ERROR asc:11,0 (Unrecovered read error)
(da0:umass-sim0:0:0:0): Error 5, Unretryable error
g_vfs_done():da0p1[READ(offset=42497376256, length=131072)]error = 5
g_vfs_done():da0p1[READ(offset=42497507328, length=131072)]error = 5
g_vfs_done():da0p1[READ(offset=42497638400, length=131072)]error = 5
g_vfs_done():da0p1[WRITE(offset=964266131456, length=131072)]error = 5
g_vfs_done():da0p1[WRITE(offset=964266262528, length=131072)]error = 5
g_vfs_done():da0p1[READ(offset=7614693376, length=131072)]error = 5
g_vfs_done():da0p1[READ(offset=7614824448, length=131072)]error = 5
g_vfs_done():da0p1[WRITE(offset=964266393600, length=131072)]error = 5
g_vfs_done():da0p1[WRITE(offset=964266524672, length=131072)]error = 5
g_vfs_done():da0p1[READ(offset=7614955520, length=131072)]error = 5
g_vfs_done():da0p1[READ(offset=7615086592, length=131072)]error = 5
g_vfs_done():da0p1[WRITE(offset=26880512, length=3072)]error = 5
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-8843e1fc5/drivers/gpu/drm/drm_atomic_helper.c:577
#0 0xffffffff80e81f43 at linux_dump_stack+0x23
#1 0xffffffff828536bd at drm_atomic_helper_check_modeset+0xcd
#2 0xffffffff8279d1cf at intel_atomic_check+0x1f
#3 0xffffffff828516bb at drm_atomic_check_only+0x2ab
#4 0xffffffff82851a63 at drm_atomic_commit+0x13
#5 0xffffffff8287da38 at restore_fbdev_mode_atomic+0x1c8
#6 0xffffffff82879d5a at drm_fb_helper_restore_fbdev_mode_unlocked+0x7a
#7 0xffffffff8289f717 at vt_kms_postswitch+0x127
#8 0xffffffff80a4b79a at vt_window_switch+0x13a
#9 0xffffffff80a4880f at vtterm_cngrab+0x1f
#10 0xffffffff80b809c6 at cngrab+0x16
#11 0xffffffff80be15a5 at vpanic+0xe5
#12 0xffffffff80be14b3 at panic+0x43
#13 0xffffffff80c3152e at pctrie_remove+0x1ae
#14 0xffffffff80cafa03 at reassignbuf+0x73
#15 0xffffffff80c90639 at bdirty+0x39
#16 0xffffffff80c8f80d at brelse+0x10d
#17 0xffffffff80c920e0 at bufdone+0x2d0
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-8843e1fc5/drivers/gpu/drm/drm_atomic_helper.c:577
#0 0xffffffff80e81f43 at linux_dump_stack+0x23
#1 0xffffffff828536bd at drm_atomic_helper_check_modeset+0xcd
#2 0xffffffff8279d1cf at intel_atomic_check+0x1f
#3 0xffffffff828516bb at drm_atomic_check_only+0x2ab
#4 0xffffffff82851a63 at drm_atomic_commit+0x13
#5 0xffffffff8287da38 at restore_fbdev_mode_atomic+0x1c8
#6 0xffffffff82879d5a at drm_fb_helper_restore_fbdev_mode_unlocked+0x7a
#7 0xffffffff8289f717 at vt_kms_postswitch+0x127
#8 0xffffffff80a4b79a at vt_window_switch+0x13a
#9 0xffffffff80a4880f at vtterm_cngrab+0x1f
#10 0xffffffff80b809c6 at cngrab+0x16
#11 0xffffffff80be15a5 at vpanic+0xe5
#12 0xffffffff80be14b3 at panic+0x43
#13 0xffffffff80c3152e at pctrie_remove+0x1ae
#14 0xffffffff80cafa03 at reassignbuf+0x73
#15 0xffffffff80c90639 at bdirty+0x39
#16 0xffffffff80c8f80d at brelse+0x10d
#17 0xffffffff80c920e0 at bufdone+0x2d0
WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /wrkdirs/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-8843e1fc5/drivers/gpu/drm/drm_atomic_helper.c:577
#0 0xffffffff80e81f43 at linux_dump_stack+0x23
#1 0xffffffff828536bd at drm_atomic_helper_check_modeset+0xcd
#2 0xffffffff8279d1cf at intel_atomic_check+0x1f
#3 0xffffffff828516bb at drm_atomic_check_only+0x2ab
#4 0xffffffff82851a63 at drm_atomic_commit+0x13
#5 0xffffffff8287da38 at restore_fbdev_mode_atomic+0x1c8
#6 0xffffffff82879d5a at drm_fb_helper_restore_fbdev_mode_unlocked+0x7a
#7 0xffffffff8289f717 at vt_kms_postswitch+0x127
#8 0xffffffff80a4b79a at vt_window_switch+0x13a
#9 0xffffffff80a4880f at vtterm_cngrab+0x1f
#10 0xffffffff80b809c6 at cngrab+0x16
#11 0xffffffff80be15a5 at vpanic+0xe5
#12 0xffffffff80be14b3 at panic+0x43
#13 0xffffffff80c3152e at pctrie_remove+0x1ae
#14 0xffffffff80cafa03 at reassignbuf+0x73
#15 0xffffffff80c90639 at bdirty+0x39
#16 0xffffffff80c8f80d at brelse+0x10d
#17 0xffffffff80c920e0 at bufdone+0x2d0
WARNING !drm_modeset_is_locked(&dev->mode_config.connection_mutex) failed at /wrkdirs/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-8843e1fc5/drivers/gpu/drm/drm_atomic_helper.c:622
#0 0xffffffff80e81f43 at linux_dump_stack+0x23
#1 0xffffffff82853840 at drm_atomic_helper_check_modeset+0x250
#2 0xffffffff8279d1cf at intel_atomic_check+0x1f
#3 0xffffffff828516bb at drm_atomic_check_only+0x2ab
#4 0xffffffff82851a63 at drm_atomic_commit+0x13
#5 0xffffffff8287da38 at restore_fbdev_mode_atomic+0x1c8
#6 0xffffffff82879d5a at drm_fb_helper_restore_fbdev_mode_unlocked+0x7a
#7 0xffffffff8289f717 at vt_kms_postswitch+0x127
#8 0xffffffff80a4b79a at vt_window_switch+0x13a
#9 0xffffffff80a4880f at vtterm_cngrab+0x1f
#10 0xffffffff80b809c6 at cngrab+0x16
#11 0xffffffff80be15a5 at vpanic+0xe5
#12 0xffffffff80be14b3 at panic+0x43
#13 0xffffffff80c3152e at pctrie_remove+0x1ae
#14 0xffffffff80cafa03 at reassignbuf+0x73
#15 0xffffffff80c90639 at bdirty+0x39
#16 0xffffffff80c8f80d at brelse+0x10d
#17 0xffffffff80c920e0 at bufdone+0x2d0
WARNING !drm_modeset_is_locked(&plane->mutex) failed at /wrkdirs/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-8843e1fc5/drivers/gpu/drm/drm_atomic_helper.c:821
#0 0xffffffff80e81f43 at linux_dump_stack+0x23
#1 0xffffffff82854917 at drm_atomic_helper_check_planes+0xa7
#2 0xffffffff8279deec at intel_atomic_check+0xd3c
#3 0xffffffff828516bb at drm_atomic_check_only+0x2ab
#4 0xffffffff82851a63 at drm_atomic_commit+0x13
#5 0xffffffff8287da38 at restore_fbdev_mode_atomic+0x1c8
#6 0xffffffff82879d5a at drm_fb_helper_restore_fbdev_mode_unlocked+0x7a
#7 0xffffffff8289f717 at vt_kms_postswitch+0x127
#8 0xffffffff80a4b79a at vt_window_switch+0x13a
#9 0xffffffff80a4880f at vtterm_cngrab+0x1f
#10 0xffffffff80b809c6 at cngrab+0x16
#11 0xffffffff80be15a5 at vpanic+0xe5
#12 0xffffffff80be14b3 at panic+0x43
#13 0xffffffff80c3152e at pctrie_remove+0x1ae
#14 0xffffffff80cafa03 at reassignbuf+0x73
#15 0xffffffff80c90639 at bdirty+0x39
#16 0xffffffff80c8f80d at brelse+0x10d
#17 0xffffffff80c920e0 at bufdone+0x2d0
WARNING !drm_modeset_is_locked(&plane->mutex) failed at /wrkdirs/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-8843e1fc5/drivers/gpu/drm/drm_atomic_helper.c:821
#0 0xffffffff80e81f43 at linux_dump_stack+0x23
#1 0xffffffff82854917 at drm_atomic_helper_check_planes+0xa7
#2 0xffffffff8279deec at intel_atomic_check+0xd3c
#3 0xffffffff828516bb at drm_atomic_check_only+0x2ab
#4 0xffffffff82851a63 at drm_atomic_commit+0x13
#5 0xffffffff8287da38 at restore_fbdev_mode_atomic+0x1c8
#6 0xffffffff82879d5a at drm_fb_helper_restore_fbdev_mode_unlocked+0x7a
#7 0xffffffff8289f717 at vt_kms_postswitch+0x127
#8 0xffffffff80a4b79a at vt_window_switch+0x13a
#9 0xffffffff80a4880f at vtterm_cngrab+0x1f
#10 0xffffffff80b809c6 at cngrab+0x16
#11 0xffffffff80be15a5 at vpanic+0xe5
#12 0xffffffff80be14b3 at panic+0x43
#13 0xffffffff80c3152e at pctrie_remove+0x1ae
#14 0xffffffff80cafa03 at reassignbuf+0x73
#15 0xffffffff80c90639 at bdirty+0x39
#16 0xffffffff80c8f80d at brelse+0x10d
#17 0xffffffff80c920e0 at bufdone+0x2d0
WARNING !drm_modeset_is_locked(&plane->mutex) failed at /wrkdirs/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-8843e1fc5/drivers/gpu/drm/drm_atomic_helper.c:821
#0 0xffffffff80e81f43 at linux_dump_stack+0x23
#1 0xffffffff82854917 at drm_atomic_helper_check_planes+0xa7
#2 0xffffffff8279deec at intel_atomic_check+0xd3c
#3 0xffffffff828516bb at drm_atomic_check_only+0x2ab
#4 0xffffffff82851a63 at drm_atomic_commit+0x13
#5 0xffffffff8287da38 at restore_fbdev_mode_atomic+0x1c8
#6 0xffffffff82879d5a at drm_fb_helper_restore_fbdev_mode_unlocked+0x7a
#7 0xffffffff8289f717 at vt_kms_postswitch+0x127
#8 0xffffffff80a4b79a at vt_window_switch+0x13a
#9 0xffffffff80a4880f at vtterm_cngrab+0x1f
#10 0xffffffff80b809c6 at cngrab+0x16
#11 0xffffffff80be15a5 at vpanic+0xe5
#12 0xffffffff80be14b3 at panic+0x43
#13 0xffffffff80c3152e at pctrie_remove+0x1ae
#14 0xffffffff80cafa03 at reassignbuf+0x73
#15 0xffffffff80c90639 at bdirty+0x39
#16 0xffffffff80c8f80d at brelse+0x10d
#17 0xffffffff80c920e0 at bufdone+0x2d0
WARNING !drm_modeset_is_locked(&plane->mutex) failed at /wrkdirs/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-8843e1fc5/drivers/gpu/drm/drm_atomic_helper.c:821
#0 0xffffffff80e81f43 at linux_dump_stack+0x23
#1 0xffffffff82854917 at drm_atomic_helper_check_planes+0xa7
#2 0xffffffff8279deec at intel_atomic_check+0xd3c
#3 0xffffffff828516bb at drm_atomic_check_only+0x2ab
#4 0xffffffff82851a63 at drm_atomic_commit+0x13
#5 0xffffffff8287da38 at restore_fbdev_mode_atomic+0x1c8
#6 0xffffffff82879d5a at drm_fb_helper_restore_fbdev_mode_unlocked+0x7a
#7 0xffffffff8289f717 at vt_kms_postswitch+0x127
#8 0xffffffff80a4b79a at vt_window_switch+0x13a
#9 0xffffffff80a4880f at vtterm_cngrab+0x1f
#10 0xffffffff80b809c6 at cngrab+0x16
#11 0xffffffff80be15a5 at vpanic+0xe5
#12 0xffffffff80be14b3 at panic+0x43
#13 0xffffffff80c3152e at pctrie_remove+0x1ae
#14 0xffffffff80cafa03 at reassignbuf+0x73
#15 0xffffffff80c90639 at bdirty+0x39
#16 0xffffffff80c8f80d at brelse+0x10d
#17 0xffffffff80c920e0 at bufdone+0x2d0
WARNING !drm_modeset_is_locked(&plane->mutex) failed at /wrkdirs/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-8843e1fc5/drivers/gpu/drm/drm_atomic_helper.c:821
#0 0xffffffff80e81f43 at linux_dump_stack+0x23
#1 0xffffffff82854917 at drm_atomic_helper_check_planes+0xa7
#2 0xffffffff8279deec at intel_atomic_check+0xd3c
#3 0xffffffff828516bb at drm_atomic_check_only+0x2ab
#4 0xffffffff82851a63 at drm_atomic_commit+0x13
#5 0xffffffff8287da38 at restore_fbdev_mode_atomic+0x1c8
#6 0xffffffff82879d5a at drm_fb_helper_restore_fbdev_mode_unlocked+0x7a
#7 0xffffffff8289f717 at vt_kms_postswitch+0x127
#8 0xffffffff80a4b79a at vt_window_switch+0x13a
#9 0xffffffff80a4880f at vtterm_cngrab+0x1f
#10 0xffffffff80b809c6 at cngrab+0x16
#11 0xffffffff80be15a5 at vpanic+0xe5
#12 0xffffffff80be14b3 at panic+0x43
#13 0xffffffff80c3152e at pctrie_remove+0x1ae
#14 0xffffffff80cafa03 at reassignbuf+0x73
#15 0xffffffff80c90639 at bdirty+0x39
#16 0xffffffff80c8f80d at brelse+0x10d
#17 0xffffffff80c920e0 at bufdone+0x2d0
WARNING !drm_modeset_is_locked(&plane->mutex) failed at /wrkdirs/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-8843e1fc5/drivers/gpu/drm/drm_atomic_helper.c:821
#0 0xffffffff80e81f43 at linux_dump_stack+0x23
#1 0xffffffff82854917 at drm_atomic_helper_check_planes+0xa7
#2 0xffffffff8279deec at intel_atomic_check+0xd3c
#3 0xffffffff828516bb at drm_atomic_check_only+0x2ab
#4 0xffffffff82851a63 at drm_atomic_commit+0x13
#5 0xffffffff8287da38 at restore_fbdev_mode_atomic+0x1c8
#6 0xffffffff82879d5a at drm_fb_helper_restore_fbdev_mode_unlocked+0x7a
#7 0xffffffff8289f717 at vt_kms_postswitch+0x127
#8 0xffffffff80a4b79a at vt_window_switch+0x13a
#9 0xffffffff80a4880f at vtterm_cngrab+0x1f
#10 0xffffffff80b809c6 at cngrab+0x16
#11 0xffffffff80be15a5 at vpanic+0xe5
#12 0xffffffff80be14b3 at panic+0x43
#13 0xffffffff80c3152e at pctrie_remove+0x1ae
#14 0xffffffff80cafa03 at reassignbuf+0x73
#15 0xffffffff80c90639 at bdirty+0x39
#16 0xffffffff80c8f80d at brelse+0x10d
#17 0xffffffff80c920e0 at bufdone+0x2d0
WARNING !drm_modeset_is_locked(&plane->mutex) failed at /wrkdirs/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-8843e1fc5/drivers/gpu/drm/drm_atomic_helper.c:821
#0 0xffffffff80e81f43 at linux_dump_stack+0x23
#1 0xffffffff82854917 at drm_atomic_helper_check_planes+0xa7
#2 0xffffffff8279deec at intel_atomic_check+0xd3c
#3 0xffffffff828516bb at drm_atomic_check_only+0x2ab
#4 0xffffffff82851a63 at drm_atomic_commit+0x13
#5 0xffffffff8287da38 at restore_fbdev_mode_atomic+0x1c8
#6 0xffffffff82879d5a at drm_fb_helper_restore_fbdev_mode_unlocked+0x7a
#7 0xffffffff8289f717 at vt_kms_postswitch+0x127
#8 0xffffffff80a4b79a at vt_window_switch+0x13a
#9 0xffffffff80a4880f at vtterm_cngrab+0x1f
#10 0xffffffff80b809c6 at cngrab+0x16
#11 0xffffffff80be15a5 at vpanic+0xe5
#12 0xffffffff80be14b3 at panic+0x43
#13 0xffffffff80c3152e at pctrie_remove+0x1ae
#14 0xffffffff80cafa03 at reassignbuf+0x73
#15 0xffffffff80c90639 at bdirty+0x39
#16 0xffffffff80c8f80d at brelse+0x10d
#17 0xffffffff80c920e0 at bufdone+0x2d0
WARNING !drm_modeset_is_locked(&plane->mutex) failed at /wrkdirs/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-8843e1fc5/drivers/gpu/drm/drm_atomic_helper.c:821
#0 0xffffffff80e81f43 at linux_dump_stack+0x23
#1 0xffffffff82854917 at drm_atomic_helper_check_planes+0xa7
#2 0xffffffff8279deec at intel_atomic_check+0xd3c
#3 0xffffffff828516bb at drm_atomic_check_only+0x2ab
#4 0xffffffff82851a63 at drm_atomic_commit+0x13
#5 0xffffffff8287da38 at restore_fbdev_mode_atomic+0x1c8
#6 0xffffffff82879d5a at drm_fb_helper_restore_fbdev_mode_unlocked+0x7a
#7 0xffffffff8289f717 at vt_kms_postswitch+0x127
#8 0xffffffff80a4b79a at vt_window_switch+0x13a
#9 0xffffffff80a4880f at vtterm_cngrab+0x1f
#10 0xffffffff80b809c6 at cngrab+0x16
#11 0xffffffff80be15a5 at vpanic+0xe5
#12 0xffffffff80be14b3 at panic+0x43
#13 0xffffffff80c3152e at pctrie_remove+0x1ae
#14 0xffffffff80cafa03 at reassignbuf+0x73
#15 0xffffffff80c90639 at bdirty+0x39
#16 0xffffffff80c8f80d at brelse+0x10d
#17 0xffffffff80c920e0 at bufdone+0x2d0
WARNING !drm_modeset_is_locked(&plane->mutex) failed at /wrkdirs/usr/ports/graphics/drm-fbsd12.0-kmod/work/kms-drm-8843e1fc5/drivers/gpu/drm/drm_atomic_helper.c:821
#0 0xffffffff80e81f43 at linux_dump_stack+0x23
#1 0xffffffff82854917 at drm_atomic_helper_check_planes+0xa7
#2 0xffffffff8279deec at intel_atomic_check+0xd3c
#3 0xffffffff828516bb at drm_atomic_check_only+0x2ab
#4 0xffffffff82851a63 at drm_atomic_commit+0x13
#5 0xffffffff8287da38 at restore_fbdev_mode_atomic+0x1c8
#6 0xffffffff82879d5a at drm_fb_helper_restore_fbdev_mode_unlocked+0x7a
#7 0xffffffff8289f717 at vt_kms_postswitch+0x127
#8 0xffffffff80a4b79a at vt_window_switch+0x13a
#9 0xffffffff80a4880f at vtterm_cngrab+0x1f
#10 0xffffffff80b809c6 at cngrab+0x16
#11 0xffffffff80be15a5 at vpanic+0xe5
#12 0xffffffff80be14b3 at panic+0x43
#13 0xffffffff80c3152e at pctrie_remove+0x1ae
#14 0xffffffff80cafa03 at reassignbuf+0x73
#15 0xffffffff80c90639 at bdirty+0x39
#16 0xffffffff80c8f80d at brelse+0x10d
#17 0xffffffff80c920e0 at bufdone+0x2d0
<4>WARN_ON(!mutex_is_locked(&dev->struct_mutex))
                        
<4>WARN_ON(!mutex_is_locked(&fbc->lock))
   
<4>WARN_ON(!mutex_is_locked(&fbc->lock))WARN_ON(!mutex_is_locked(&fbc->lock))WARN_ON(!mutex_is_locked(&fbc->lock))
panic: pctrie_remove: impossible to locate the key
cpuid = 3
time = 1649598985
KDB: stack backtrace:
#0 0xffffffff80c2d4a5 at kdb_backtrace+0x65
#1 0xffffffff80be163b at vpanic+0x17b
#2 0xffffffff80be14b3 at panic+0x43
#3 0xffffffff80c3152e at pctrie_remove+0x1ae
#4 0xffffffff80cafa03 at reassignbuf+0x73
#5 0xffffffff80c90639 at bdirty+0x39
#6 0xffffffff80c8f80d at brelse+0x10d
#7 0xffffffff80c920e0 at bufdone+0x2d0
#8 0xffffffff80b2db2b at g_io_deliver+0x1eb
#9 0xffffffff80b2db2b at g_io_deliver+0x1eb
#10 0xffffffff80b2aab2 at g_disk_done+0x102
#11 0xffffffff80c2665e at bioq_flush+0x7e
#12 0xffffffff80382698 at cam_iosched_flush+0x18
#13 0xffffffff803bcdab at dadone+0x15b
#14 0xffffffff8038cd77 at xpt_done_process+0x407
#15 0xffffffff8038f035 at xpt_done_td+0xf5
#16 0xffffffff80ba2a0e at fork_exit+0x7e
#17 0xffffffff810d61de at fork_trampoline+0xe
Uptime: 17h33m36s
Dumping 837 out of 8023 MB:..2%..12%..22%..31%..41%..52%..62%..71%..81%..92%

__curthread () at /usr/src/sys/amd64/include/pcpu_aux.h:55
55		__asm("movq %%gs:%P1,%0" : "=r" (td) : "n" (offsetof(struct pcpu,
(kgdb) bt
#0  __curthread () at /usr/src/sys/amd64/include/pcpu_aux.h:55
#1  doadump (textdump=<optimized out>) at /usr/src/sys/kern/kern_shutdown.c:371
#2  0xffffffff80be1255 in kern_reboot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:452
#3  0xffffffff80be1693 in vpanic (fmt=<optimized out>, ap=<optimized out>) at /usr/src/sys/kern/kern_shutdown.c:881
#4  0xffffffff80be14b3 in panic (fmt=<unavailable>) at /usr/src/sys/kern/kern_shutdown.c:808
#5  0xffffffff80c3152e in pctrie_remove (ptree=<optimized out>, index=<unavailable>, freefn=<unavailable>) at /usr/src/sys/kern/subr_pctrie.c:621
#6  0xffffffff80cafa03 in BUF_PCTRIE_REMOVE (ptree=<unavailable>, key=<optimized out>) at /usr/src/sys/kern/vfs_subr.c:441
#7  buf_vlist_remove (bp=0xfffffe0001539420) at /usr/src/sys/kern/vfs_subr.c:2104
#8  reassignbuf (bp=0xfffffe0001539420) at /usr/src/sys/kern/vfs_subr.c:2543
#9  0xffffffff80c90639 in bdirty (bp=0xfffffe0001539420) at /usr/src/sys/kern/vfs_bio.c:2465
#10 0xffffffff80c8f80d in brelse (bp=0xfffffe0001539420) at /usr/src/sys/kern/vfs_bio.c:2658
#11 0xffffffff80c920e0 in bufdone (bp=0xfffffe0001539420) at /usr/src/sys/kern/vfs_bio.c:4458
#12 0xffffffff80b2db2b in g_io_deliver (bp=0xfffff801aabe8468, error=<optimized out>) at /usr/src/sys/geom/geom_io.c:740
#13 0xffffffff80b2db2b in g_io_deliver (bp=0xfffff801aae8ad38, error=<optimized out>) at /usr/src/sys/geom/geom_io.c:740
#14 0xffffffff80b2aab2 in g_disk_done (bp=0xfffff802024eb178) at /usr/src/sys/geom/geom_disk.c:261
#15 0xffffffff80c2665e in bioq_flush (head=0xfffff8000394db80, stp=0x0, error=5) at /usr/src/sys/kern/subr_disk.c:186
#16 0xffffffff80382698 in cam_iosched_flush (isc=0xfffff8000394db80, stp=0x0, err=5) at /usr/src/sys/cam/cam_iosched.c:1183
#17 0xffffffff803bcdab in dadone (periph=0xfffff800047e2800, done_ccb=0xfffff8011cdb6000) at /usr/src/sys/cam/scsi/scsi_da.c:4483
#18 0xffffffff8038cd77 in xpt_done_process (ccb_h=0xfffff8011cdb6000) at /usr/src/sys/cam/cam_xpt.c:5517
#19 0xffffffff8038f035 in xpt_done_td (arg=0xffffffff81bc8180 <cam_doneqs>) at /usr/src/sys/cam/cam_xpt.c:5544
#20 0xffffffff80ba2a0e in fork_exit (callout=0xffffffff8038ef40 <xpt_done_td>, arg=0xffffffff81bc8180 <cam_doneqs>, frame=0xfffffe0000438b00) at /usr/src/sys/kern/kern_fork.c:1080
#21 <signal handler called>
(kgdb) 

Maybe the disc has some hardware problems, though panic() is not the expected behaviour...

Luciano.
Comment 1 Hans Petter Selasky freebsd_committer freebsd_triage 2022-04-12 08:17:40 UTC
This is not a USB problem. Adding Warner Losh (cam layer).