tsutsui / netbsd-src

Automatic conversion of the NetBSD src CVS module, use with care. Please submit bugs/changes via https://gnats.netbsd.org
https://www.NetBSD.org
2 stars 0 forks source link

luna88k: kernel debugging assertion "(vp->v_flag & VONWORKLST)" failed #5

Closed tsutsui closed 2 years ago

tsutsui commented 2 years ago

KASSERT() is triggered on unmounting file system:

# halt
Jul 31 07:35:15 halt: halted by root
panic: kernel debugging assertion "(vp->v_flag & VONWORKLST)" failed: file "/s/tsutsui/netbsd-src/sys/miscfs/genfs/genfs_vnops.c", line 1322
Stopped in pid 17.1 (halt) at   netbsd:cpu_Debugger+0x4:                tb0     0
, r0, 0x84
db> bt
stack base = 0x68a1a88
(0) netbsd:cpu_Debugger+0x4(stackless)
(1) netbsd:panic+0x170(?, 0x108670, 10867c, 10720c, 52a, 0x65000000, 0x100000, 1
8f444)
(2) netbsd:__assert+0x2c(?, 0x108670, 10867c, 10720c, 52a, 0x65000000, 0x100000,
 18f444)
db>
tsutsui commented 2 years ago

Trying a patch in uvm_bio.c rev 1.49 based on the following tech-kern thread: http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/uvm/uvm_bio.c#rev1.49 https://mail-index.netbsd.org/tech-kern/2006/09/27/0002.html https://mail-index.netbsd.org/tech-kern/2006/09/28/0000.html https://mail-index.netbsd.org/tech-kern/2006/09/27/0003.html https://mail-index.netbsd.org/tech-kern/2006/09/28/0002.html https://mail-index.netbsd.org/tech-kern/2006/09/28/0009.html

tsutsui commented 2 years ago

Trying a patch in uvm_bio.c rev 1.49 based on the following tech-kern thread: http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/uvm/uvm_bio.c#rev1.49

No visible change..

tsutsui commented 2 years ago

After investigation, this is caused by inverted return value of pmap_unsetbit(9) via pmap_clear_modify(9), and it was (silently) fixed in OpenBSD: https://github.com/openbsd/src/commit/ae76cb509b9c0e599ede104cc04d6b2c58b1539d#diff-747c3b9dfd77e1f14471a9f38970188e909a34828f92ef704d159c1eaff0af47R2361

tsutsui commented 2 years ago

Fixed in https://github.com/tsutsui/netbsd-src/commit/6cd8cc84b2beca3bbec147f78a82782f19c05989