Subject: swap_off() and LOCKDEBUG
To: None <>
From: Juan RP <>
List: current-users
Date: 11/22/2007 13:05:34

with latest check added in subr_lockdebug.c, when I press the power button
to shutdown the system I see the following LOCKDEBUG panic:

Stopped in pid 9800.1 (swapctl) at netbsd:breakpoint +0x1: ret
breakpoint(c05136af,c050fdc5,c0472fe4,c05138e0,40000) at netbsd:breakpoint
lockdebug_locked(c05138e0,1,40000,12,12) at netbsd:lockdebug_locked
free(c2fca000,c0569860,0,ce335544,0) at netbsd:free+0x7
blist_destroy(c2eb3260,1,8007c,c0285da4,cd530a64) at netbsd:blist_destroy
sys_swapctl(ce335540,ce356c30,ce356c58,ce332698,bbbc0000) at
syscall(ce356c78,b3,ab,1f,1f) at netbsd:syscall+0x142

I've looked at the address at which the lock was initialized and this shows
ffs_mountfs(), it was unlocked in ffs_statvfs().

$ mount
/dev/wd2a on / type ffs (local)
/dev/wd2f on /var type ffs (local)
/dev/wd2e on /usr type ffs (local)
/dev/wd2g on /home type ffs (local)
/dev/wd2h on /storage type ffs (local)
/home/juan/src on /usr/src type null (local)
/home/juan/branch/src-4 on /usr/src-4 type null (local)
/home/juan/wip on /usr/pkgsrc/wip type null (local)
kernfs on /kern type kernfs (local)
ptyfs on /dev/pts type ptyfs (local)
procfs on /proc type procfs (local)
tmpfs on /tmp type tmpfs (local)
tmpfs on /storage/pkgsrc-obj type tmpfs (local)
/dev/puffs on /sysctl type puffs|sysctlfs
/dev/puffs on /mnt/disk0 type puffs|refuse:ntfs-3g (nosuid, nodev)
/dev/puffs on /mnt/disk1 type puffs|refuse:ntfs-3g (nosuid, nodev)

Juan Romero Pardines	- The NetBSD Project	- NetBSD/pkgsrc news in Spanish