Subject: Re: Panic with kernel built this morning...
To: None <>
From: None <>
List: current-users
Date: 01/02/2000 13:24:53
> Hey, all. I built -current on my i386 this morning, and then this
> afternoon did an automated CD burn. My machine evidently panicked
> and rebooted. I don't see anything obvious in my logs, but the
> only thing the box was doing out of the ordinary was the CD burn,
> and since I was asleep during the crash, I don't know if that was
> it or not... I've randomly seen panics in the past when my box
> tried to start fixing a disk in my Memorex ATAPI CD-RW drive.`
> All I know for sure:
> Jan  1 15:08:50 acheron savecore: reboot after panic: pmap_unwire: invalid (unmapped) va

Did you get a complete crash dump saved in /var/crash corresponding
to this panic?  The above message is from savecore, so that's
promising in that regard.  Note that you need more than <real-mem>
space free on /var to be able to collect a complete kernel crash

Here's some general advice on how you can find some more information
related to a panic when you have collected a complete kernel crash
dump (sorry, I can't provide any specific advice on the above

# cd /var/crash
# ls

(note latest <n> in netbsd.<n>.core)

# gdb /netbsd
(gdb) target kcore netbsd.<n>.core
(gdb) where

If you wish to dig further, you can compile a kernel with debugging
enabled (``makeoptions DEBUG=3D"-g"'' in the config file), rebuild the
entire kernel (if you're lucky, the new kernel can be used with the
kernel crash dump already collected), and

# cd /var/crash
# gdb /sys/arch/i386/compile/YOURKERNEL/netbsd.gdb
(gdb) target kcore netbsd.<n>.core
(gdb) where
(gdb) source /sys/gdbscripts/xps
(gdb) xps

(note a proc address you want to inspect, in the leftmost coloumn)

(gdb) proc <address>
(gdb) where


You can also use dmesg, ps and most other kmem grovellers (which can
also be instructed to operate on a crashdump), e.g.:

# cd /var/crash
# dmesg -M netbsd.<n>.core -N /netbsd
# ps -axlww -M netbsd.<n>.core -N /netbsd

If you by any chance should get dropped back to DDB on e.g. a panic,
and still have access to the console, and want to provoke a crash
dump, you can do that via

db> reboot <flag>

where <flag> is ORed together from the bits in <sys/reboot.h>,
possibly the two most important bits are:

#define RB_DUMP         0x100   /* dump kernel memory before reboot */
#define RB_NOSYNC       0x004   /* dont sync before reboot */

Happy bug-hunting,

- H=E5vard