panic: bad dir Stopped at db_enter+0x18: addq $0x8,%rsp TID PID UID PRFLAGS PFLAGS CPU COMMAND *368778 38573 0 0 0x4000000 0 syz-executor.6 db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff82599f7f) at panic+0x161 sys/kern/subr_prf.c:202 ufs_lookup() at ufs_lookup+0x1749 ufs_dirbad sys/ufs/ufs/ufs_lookup.c:609 [inline] ufs_lookup() at ufs_lookup+0x1749 sys/ufs/ufs/ufs_lookup.c:444 VOP_LOOKUP(fffffd806ec9ccc8,ffff8000231c74f8,ffff8000231c7528) at VOP_LOOKUP+0x58 sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000231c74c8) at vfs_lookup+0x6cc sys/kern/vfs_lookup.c:561 namei(ffff8000231c74c8) at namei+0x36a sys/kern/vfs_lookup.c:245 vn_open(ffff8000231c74c8,70f,0) at vn_open+0x188 sys/kern/vfs_vnops.c:113 doopenat(ffff8000230b8d28,ffffff9c,20000000,70e,0,ffff8000231c76b0) at doopenat+0x26a sys/kern/vfs_syscalls.c:1129 syscall(ffff8000231c7720) at syscall+0x44e sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xd50ce6456f0, count: 5 https://www.openbsd.org/ddb.html describes the minimum info required in bug reports. Insufficient info makes it difficult to find and fix bugs. ddb> ddb> set $lines = 0 ddb> set $maxwidth = 0 ddb> show panic *cpu0: bad dir ddb> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff82599f7f) at panic+0x161 sys/kern/subr_prf.c:202 ufs_lookup() at ufs_lookup+0x1749 ufs_dirbad sys/ufs/ufs/ufs_lookup.c:609 [inline] ufs_lookup() at ufs_lookup+0x1749 sys/ufs/ufs/ufs_lookup.c:444 VOP_LOOKUP(fffffd806ec9ccc8,ffff8000231c74f8,ffff8000231c7528) at VOP_LOOKUP+0x58 sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000231c74c8) at vfs_lookup+0x6cc sys/kern/vfs_lookup.c:561 namei(ffff8000231c74c8) at namei+0x36a sys/kern/vfs_lookup.c:245 vn_open(ffff8000231c74c8,70f,0) at vn_open+0x188 sys/kern/vfs_vnops.c:113 doopenat(ffff8000230b8d28,ffffff9c,20000000,70e,0,ffff8000231c76b0) at doopenat+0x26a sys/kern/vfs_syscalls.c:1129 syscall(ffff8000231c7720) at syscall+0x44e sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xd50ce6456f0, count: -10 ddb> show registers rdi 0 rsi 0x1 rbp 0xffff8000231c6f90 rbx 0 rdx 0 rcx 0 rax 0xffff8000230b8d28 r8 0x101010101010101 r9 0x8080808080808080 r10 0x10d007e858b533b0 r11 0xc6b5fa5858c71d9c r12 0 r13 0xfffffd80709a5b50 r14 0 r15 0x1 rip 0xffffffff81b399a8 db_enter+0x18 cs 0x8 rflags 0x246 rsp 0xffff8000231c6f80 ss 0x10 db_enter+0x18: addq $0x8,%rsp ddb> show proc PROC (syz-executor.6) pid=368778 stat=onproc flags process=0 proc=4000000 pri=32, usrpri=86, nice=20 forw=0xffffffffffffffff, list=0xffff8000230b82a8,0xffff800027f3afd8 process=0xffff80002b37afc8 user=0xffff8000231c2000, vmspace=0xfffffd806c67d560 estcpu=36, cpticks=1, pctcpu=0.0 user=0, sys=1, intr=0 ddb> ps PID TID PPID UID S FLAGS WAIT COMMAND 38573 37755 80189 0 2 0 syz-executor.6 *38573 368778 80189 0 7 0x4000000 syz-executor.6 38573 132535 80189 0 3 0x4000080 fsleep syz-executor.6 38573 283801 80189 0 2 0x4000000 syz-executor.6 86603 463344 59092 0 2 0 syz-executor.7 86603 356723 59092 0 3 0x4000080 fsleep syz-executor.7 59092 172423 48376 0 2 0x482 syz-executor.7 53636 333612 48376 0 2 0x2 syz-executor.0 7572 70562 48376 0 2 0x2 syz-executor.4 55362 219753 0 0 3 0x14200 bored sosplice 7804 227213 48376 0 2 0x2 syz-executor.2 89292 120076 0 0 3 0x14280 nfsidl nfsio 5378 115302 0 0 3 0x14280 nfsidl nfsio 33325 378066 0 0 3 0x14280 nfsidl nfsio 62926 309571 0 0 3 0x14280 nfsidl nfsio 5218 13554 0 0 3 0x14280 nfsidl nfsio 89786 319637 0 0 3 0x14280 nfsidl nfsio 20378 320200 0 0 3 0x14280 nfsidl nfsio 57397 55816 0 0 3 0x14280 nfsidl nfsio 99946 262644 0 0 3 0x14280 nfsidl nfsio 74200 353182 0 0 3 0x14280 nfsidl nfsio 49079 501135 0 0 3 0x14280 nfsidl nfsio 43901 72137 0 0 3 0x14280 nfsidl nfsio 87411 419251 0 0 3 0x14280 nfsidl nfsio 41412 453234 0 0 3 0x14280 nfsidl nfsio 70816 92974 0 0 3 0x14280 nfsidl nfsio 294 463389 0 0 3 0x14280 nfsidl nfsio 35383 66241 0 0 3 0x14280 nfsidl nfsio 9237 463900 0 0 3 0x14280 nfsidl nfsio 37810 28215 0 0 3 0x14280 nfsidl nfsio 98426 45057 0 0 3 0x14280 nfsidl nfsio 31084 487679 48376 0 2 0x2 syz-executor.3 37774 428191 48376 0 3 0x82 nanoslp syz-executor.1 80189 97795 48376 0 2 0x482 syz-executor.6 63220 264597 48376 0 2 0x2 syz-executor.5 48376 326604 14013 0 3 0x82 thrsleep syz-fuzzer 48376 82170 14013 0 2 0x4000482 syz-fuzzer 48376 63061 14013 0 3 0x4000082 thrsleep syz-fuzzer 48376 76961 14013 0 3 0x4000082 thrsleep syz-fuzzer 48376 439606 14013 0 3 0x4000082 thrsleep syz-fuzzer 48376 456932 14013 0 3 0x4000082 kqread syz-fuzzer 48376 384319 14013 0 3 0x4000082 thrsleep syz-fuzzer 48376 144507 14013 0 3 0x4000082 thrsleep syz-fuzzer 14013 167666 78856 0 3 0x10008a sigsusp ksh 78856 512924 21301 0 3 0x9a kqread sshd 31346 202307 1 0 3 0x100083 ttyin getty 21301 435208 1 0 3 0x88 kqread sshd 69675 223676 9383 73 3 0x1100090 kqread syslogd 9383 273936 1 0 3 0x100082 netio syslogd 66627 51528 1 0 3 0x100080 kqread resolvd 12944 256340 35055 77 3 0x100092 kqread dhcpleased 5602 403476 35055 77 3 0x100092 kqread dhcpleased 35055 157566 1 0 3 0x80 kqread dhcpleased 4882 419916 0 0 3 0x14200 bored smr 8995 452886 0 0 2 0x14200 zerothread 49357 264799 0 0 3 0x14200 aiodoned aiodoned 37814 193099 0 0 3 0x14200 syncer update 56966 105769 0 0 3 0x14200 cleaner cleaner 20169 244138 0 0 3 0x14200 reaper reaper 22627 335576 0 0 3 0x14200 pgdaemon pagedaemon 40400 384152 0 0 3 0x14200 bored viomb 19536 492641 0 0 3 0x40014200 acpi0 acpi0 94998 18632 0 0 3 0x14200 bored softnet 69709 98126 0 0 3 0x14200 bored systqmp 60666 305460 0 0 3 0x14200 bored systq 80913 354987 0 0 2 0x40014200 softclock 52026 90882 0 0 3 0x40014200 idle0 1 185323 0 0 3 0x82 wait init 0 0 -1 0 3 0x10200 scheduler swapper ddb> show all locks No such command ddb> show malloc Type InUse MemUse HighUse Limit Requests Type Lim devbuf 10173 6418K 6935K 78643K 18161 0 pcb 13 15K 17K 78643K 360 0 rtable 252 19K 19K 78643K 1770 0 ifaddr 98 27K 28K 78643K 5078 0 sysctl 2 0K 0K 78643K 6 0 counters 28 17K 17K 78643K 429 0 ioctlops 0 0K 12K 78643K 27037 0 iov 0 0K 16K 78643K 2382 0 mount 1 1K 1K 78643K 1 0 log 0 0K 0K 78643K 4 0 vnodes 1397 87K 87K 78643K 3867 0 UFS quota 1 32K 32K 78643K 1 0 UFS mount 5 36K 36K 78643K 5 0 shm 2 1K 13K 78643K 669 0 VM map 2 0K 0K 78643K 2 0 sem 12 0K 1K 78643K 4670 0 dirhash 12 2K 2K 78643K 12 0 ACPI 1697 195K 286K 78643K 12548 0 file desc 12 41K 73K 78643K 19682 0 sigio 0 0K 0K 78643K 51 0 proc 58 59K 75K 78643K 1555 0 subproc 104 6K 6K 78643K 221 0 NFS srvsock 1 0K 0K 78643K 1 0 NFS daemon 1 16K 16K 78643K 1 0 ip_moptions 0 0K 0K 78643K 236 0 in_multi 75 5K 7K 78643K 242 0 ether_multi 1 0K 0K 78643K 15 0 mrt 0 0K 0K 78643K 10 0 ISOFS mount 1 32K 32K 78643K 1 0 MSDOSFS mount 1 16K 16K 78643K 1 0 ttys 67 307K 307K 78643K 67 0 exec 0 0K 2K 78643K 5754 0 tdb 3 0K 0K 78643K 3 0 pagedep 1 8K 8K 78643K 1 0 inodedep 1 32K 32K 78643K 1 0 newblk 1 0K 0K 78643K 1 0 VM swap 7 26K 26K 78643K 7 0 UVM amap 316 298K 343K 78643K 105595 0 UVM aobj 131 7K 7K 78643K 137 0 memdesc 1 4K 4K 78643K 1 0 crypto data 1 1K 1K 78643K 1 0 ip6_options 0 0K 0K 78643K 94 0 NDP 13 0K 1K 78643K 448 0 temp 169 4796K 4860K 78643K 89634 0 kqueue 12 18K 24K 78643K 543 0 SYN cache 2 16K 16K 78643K 2 0 ddb> show all pools Name Size Requests Fail Releases Pgreq Pgrel Npage Hiwat Minpg Maxpg Idle rtpcb 120 1994 0 1991 27 26 1 3 0 8 0 rtentry 112 368 0 280 4 0 4 4 0 8 0 unpcb 136 4104 0 4091 52 51 1 8 0 8 0 syncache 296 83 0 83 9 9 0 1 0 8 0 tcpqe 32 111 0 111 9 9 0 1 0 8 0 tcpcb 736 8726 0 8710 172 162 10 18 0 8 8 arp 88 39 0 23 1 0 1 1 0 8 0 ipq 40 21 0 19 6 5 1 1 0 8 0 ipqe 40 915 0 913 6 5 1 1 0 8 0 inpcb 312 10037 0 10030 135 129 6 15 0 8 5 rttmr 72 2 0 2 1 1 0 1 0 8 0 nd6 48 64 0 39 1 0 1 1 0 8 0 kcovpl 48 17 0 9 1 0 1 1 0 8 0 ppxss 1152 17 0 17 2 2 0 1 0 8 0 pfosfp 40 13 0 12 2 1 1 1 0 8 0 pfosfpen 112 13 0 12 2 1 1 1 0 8 0 pfrktable 1344 390 0 363 4 1 3 3 0 8 0 pftag 88 27 0 10 1 0 1 1 0 8 0 pfqueue 264 6 0 6 3 3 0 1 0 8 0 pfrule 1360 7507 0 5597 164 4 160 160 0 8 0 art_heap8 4096 1 0 0 1 0 1 1 0 8 0 art_heap4 256 1016 0 645 36 12 24 29 0 8 0 art_table 32 1017 0 645 4 0 4 4 0 8 0 art_node 16 365 0 287 1 0 1 1 0 8 0 sysvmsgpl 40 40 0 32 1 0 1 1 0 8 0 semapl 112 4668 0 4658 1 0 1 1 0 8 0 shmpl 112 134 0 6 4 0 4 4 0 8 0 dirhash 1024 17 0 0 3 0 3 3 0 8 0 dino2pl 256 28102 0 26635 92 0 92 92 0 8 0 ffsino 240 28102 0 26635 87 0 87 87 0 8 0 nchpl 144 54920 0 53287 63 0 63 63 0 8 0 uvmvnodes 80 5926 0 0 121 0 121 121 0 8 0 vnodes 224 5926 0 0 349 0 349 349 0 8 0 namei 1024 176599 0 176595 3 2 1 2 0 8 0 vcpupl 1984 24 0 3 3 0 3 3 0 8 0 vmpool 528 34 0 13 2 0 2 2 0 8 0 pfiaddrpl 120 448 0 8 15 1 14 14 0 8 0 kstatmem 264 828 0 802 3 1 2 3 0 8 0 scsiplug 72 7 0 7 2 2 0 1 0 8 0 scxspl 216 162526 0 162526 16 15 1 8 0 8 1 plimitpl 152 201 0 187 1 0 1 1 0 8 0 sigapl 424 19971 0 19913 8 0 8 8 0 8 0 futexpl 64 210437 0 210435 1 0 1 1 0 8 0 knotepl 120 174898 0 174818 26 23 3 7 0 8 0 kqueuepl 184 1580 0 1572 19 18 1 4 0 8 0 pipepl 304 2358 0 2330 71 68 3 10 0 8 0 fdescpl 432 19936 0 19913 4 0 4 4 0 8 0 filepl 120 100041 0 99800 125 113 12 21 0 8 4 lockfpl 104 4004 0 4002 8 7 1 2 0 8 0 lockfspl 48 800 0 798 1 0 1 1 0 8 0 sessionpl 144 32 0 16 1 0 1 1 0 8 0 pgrppl 48 122 0 106 1 0 1 1 0 8 0 ucredpl 96 2963 0 2953 1 0 1 1 0 8 0 zombiepl 144 19914 0 19913 2 1 1 1 0 8 0 processpl 1000 19971 0 19913 9 1 8 9 0 8 0 procpl 672 49868 0 49799 28 20 8 9 0 8 1 sosppl 168 4 0 4 1 1 0 1 0 8 0 sockpl 448 16139 0 16116 268 257 11 25 0 8 8 mcl64k 65536 331 0 331 23 22 1 1 0 8 1 mcl16k 16384 125 0 125 28 27 1 1 0 8 1 mcl12k 12288 416 0 416 26 25 1 1 0 8 1 mcl9k 9216 251 0 251 26 25 1 1 0 8 1 mcl8k 8192 1147 0 1147 20 19 1 1 0 8 1 mcl4k 4096 3507 0 3507 9 8 1 1 0 8 1 mcl2k2 2112 120 0 120 31 30 1 1 0 8 1 mcl2k 2048 105177 0 105129 41 33 8 11 0 8 0 mtagpl 96 505 0 424 9 6 3 4 0 8 0 mbufpl 256 271635 0 271343 121 98 23 60 0 8 1 bufpl 288 31828 0 25424 458 0 458 458 0 8 0 anonpl 24 3335197 0 3317349 154 39 115 131 0 188 0 amapchunkpl 152 302411 0 301800 56 28 28 32 0 158 0 amappl16 200 40320 0 39699 56 22 34 46 0 8 0 amappl15 192 3673 0 3669 1 0 1 1 0 8 0 amappl14 184 4388 0 4385 1 0 1 1 0 8 0 amappl13 176 4114 0 4113 1 0 1 1 0 8 0 amappl12 168 1038 0 1037 3 2 1 1 0 8 0 amappl11 160 2871 0 2856 1 0 1 1 0 8 0 amappl10 152 2511 0 2504 1 0 1 1 0 8 0 amappl9 144 574 0 570 1 0 1 1 0 8 0 amappl8 136 2087 0 1980 5 1 4 4 0 8 0 amappl7 128 1272 0 1260 1 0 1 1 0 8 0 amappl6 120 389 0 370 2 1 1 2 0 8 0 amappl5 112 20575 0 20562 1 0 1 1 0 8 0 amappl4 104 4236 0 4201 2 0 2 2 0 8 0 amappl3 96 58875 0 58839 2 0 2 2 0 8 0 amappl2 88 24925 0 24865 3 1 2 3 0 8 0 amappl1 80 464445 0 463900 43 28 15 19 0 8 1 amappl 88 104316 0 104159 7 2 5 5 0 92 0 dma4096 4096 1 0 1 1 1 0 1 0 8 0 dma1024 1024 1 0 0 1 0 1 1 0 8 0 dma256 256 6 0 6 1 1 0 1 0 8 0 dma128 128 253 0 253 1 1 0 1 0 8 0 dma64 64 6 0 6 1 1 0 1 0 8 0 dma32 32 7 0 7 1 1 0 1 0 8 0 dma16 16 18 0 17 1 0 1 1 0 8 0 aobjpl 72 136 0 6 3 0 3 3 0 8 0 uaddrrnd 24 19970 0 19926 1 0 1 1 0 8 0 uaddrbest 32 2 0 0 1 0 1 1 0 8 0 uaddr 24 19970 0 19926 1 0 1 1 0 8 0 vmmpekpl 168 123635 0 123576 4 1 3 3 0 8 0 vmmpepl 168 1874023 0 1871707 212 87 125 138 0 357 2 vmsppl 272 19969 0 19926 5 1 4 4 0 8 0 rwobjpl 24 433104 0 425462 48 0 48 48 0 8 0 pdppl 4096 39946 0 39873 516 431 85 88 0 8 12 pvpl 32 6432308 0 6411119 322 137 185 230 0 265 3 pmappl 216 19969 0 19926 3 0 3 3 0 8 0 extentpl 40 58 0 38 1 0 1 1 0 8 0 phpool 112 2185 0 1207 29 0 29 29 0 8 0 ddb> machine ddbcpu 0 No such command ddb> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff82599f7f) at panic+0x161 sys/kern/subr_prf.c:202 ufs_lookup() at ufs_lookup+0x1749 ufs_dirbad sys/ufs/ufs/ufs_lookup.c:609 [inline] ufs_lookup() at ufs_lookup+0x1749 sys/ufs/ufs/ufs_lookup.c:444 VOP_LOOKUP(fffffd806ec9ccc8,ffff8000231c74f8,ffff8000231c7528) at VOP_LOOKUP+0x58 sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000231c74c8) at vfs_lookup+0x6cc sys/kern/vfs_lookup.c:561 namei(ffff8000231c74c8) at namei+0x36a sys/kern/vfs_lookup.c:245 vn_open(ffff8000231c74c8,70f,0) at vn_open+0x188 sys/kern/vfs_vnops.c:113 doopenat(ffff8000230b8d28,ffffff9c,20000000,70e,0,ffff8000231c76b0) at doopenat+0x26a sys/kern/vfs_syscalls.c:1129 syscall(ffff8000231c7720) at syscall+0x44e sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xd50ce6456f0, count: -10 ddb> machine ddbcpu 1 No such command ddb> trace db_enter() at db_enter+0x18 sys/arch/amd64/amd64/db_interface.c:437 panic(ffffffff82599f7f) at panic+0x161 sys/kern/subr_prf.c:202 ufs_lookup() at ufs_lookup+0x1749 ufs_dirbad sys/ufs/ufs/ufs_lookup.c:609 [inline] ufs_lookup() at ufs_lookup+0x1749 sys/ufs/ufs/ufs_lookup.c:444 VOP_LOOKUP(fffffd806ec9ccc8,ffff8000231c74f8,ffff8000231c7528) at VOP_LOOKUP+0x58 sys/kern/vfs_vops.c:85 vfs_lookup(ffff8000231c74c8) at vfs_lookup+0x6cc sys/kern/vfs_lookup.c:561 namei(ffff8000231c74c8) at namei+0x36a sys/kern/vfs_lookup.c:245 vn_open(ffff8000231c74c8,70f,0) at vn_open+0x188 sys/kern/vfs_vnops.c:113 doopenat(ffff8000230b8d28,ffffff9c,20000000,70e,0,ffff8000231c76b0) at doopenat+0x26a sys/kern/vfs_syscalls.c:1129 syscall(ffff8000231c7720) at syscall+0x44e sys/arch/amd64/amd64/trap.c:585 Xsyscall() at Xsyscall+0x128 end of kernel end trace frame: 0xd50ce6456f0, count: -10