Subject: panic: pv_unlink0 - status report
To: None <port-sparc@NetBSD.ORG>
From: Erik E. Fair <fair@clock.org>
List: port-sparc
Date: 05/02/1997 22:16:29
Some new data on this problem.

Configuration: 96M SPARC LX, running NetBSD-current as of Apr 30th.

First encounter with this panic was most ghastly: my system died near the
end of /etc/rc during multiuser boot. Every time.

I assumed it might be a too-much-memory problem. Removed 32M of the 96M
(leaving 64M). Reboot. The system stayed up about an hour.

OK, tried again: remove another 32M, leaving 32M. System died after two
hours or so.

OK, so let's compile a debug kernel (makeoptions DEBUG="-g"), and put back
all the removed RAM (so we get an instant death with core dump).

System stayed up for a day.

I just tried to compile a new kernel with more PTYs, and removing some
unnecessary device drivers. Reboot. The system died near the end of /etc/rc
again. No good core dump this time.

Based on the evidence, I think I'm just plain lucky that the kernel I have
now will stay stable for 24 hours at a time.

Based on the dumps I've seen, the proximate cause has been (so far), either
sunos_* or sys_read; I don't think this is an emulation bug. It looks like
an honest VM bug.

Any assistance would be appreciated.

	Erik Fair <fair@clock.org> (reply to fair@fish.com, please)


Here's the stack backtrace from one of the better crash dumps I have:

fair@cesium 3} gdb -k /sys/arch/sparc/compile/CESIUM/netbsd.gdb netbsd.7.core
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.11 (sparc-netbsd), Copyright 1993 Free Software Foundation, Inc...
panic: pv_unlink0
#0  0xf80f66c4 in dumpsys () at ../../../../arch/sparc/sparc/machdep.c:766
766             snapshot(cpcb);
(kgdb) where
#0  0xf80f66c4 in dumpsys () at ../../../../arch/sparc/sparc/machdep.c:766
#1  0xf80f6478 in cpu_reboot (howto=256, user_boot_string=0x0)
    at ../../../../arch/sparc/sparc/machdep.c:676
#2  0xf802b3c4 in panic (fmt=0x0) at ../../../../kern/subr_prf.c:149
#3  0xf80f89a4 in pv_unlink4m (pv=0xf81cb080, pm=0xf81306b8, va=4170711040)
    at ../../../../arch/sparc/sparc/pmap.c:2356
#4  0xf80fb974 in pmap_enk4m (pm=0xf81306b8, va=4170711040, prot=7,
wired=-132657152,
    pv=0xf81ba680, pteproto=4106398) at
../../../../arch/sparc/sparc/pmap.c:5375
#5  0xf80fb7e4 in pmap_enter4m (pm=0xf81306b8, va=4170711040, pa=65699840,
prot=7, wired=1)
    at ../../../../arch/sparc/sparc/pmap.c:5315
#6  0xf80cd57c in vm_fault (map=0xf81dc108, vaddr=4170711040, fault_type=7,
change_wiring=1)
    at ../../../../vm/vm_fault.c:826
#7  0xf80cd72c in vm_fault_wire (map=0xf81dc108, start=4170682368,
end=4170715136)
    at ../../../../vm/vm_fault.c:884
#8  0xf80cfb40 in vm_map_pageable (map=0xf81dc108, start=4170682368,
end=4170715136,
    new_pageable=0) at ../../../../vm/vm_map.c:1337
#9  0xf80ce680 in kmem_malloc (map=0xf81dc108, size=32768, canwait=0)
    at ../../../../vm/vm_kern.c:321
#10 0xf802075c in malloc (size=32768, type=84, flags=0) at
../../../../kern/kern_malloc.c:145
#11 0xf810e7c0 in sunos_sys_getdents (p=0xf8960000, v=0xfc71af28,
retval=0xfc71af20)
    at ../../../../compat/sunos/sunos_misc.c:456
#12 0xf80fe9f0 in syscall (code=174, tf=0xfc71afb0, pc=268487316)
    at ../../../../arch/sparc/sparc/trap.c:1100
(kgdb)