Subject: Re: kernel postmortem?
To: None <port-mac68k@netbsd.org>
From: John Valdes <valdes@macavity.uchicago.edu>
List: port-mac68k
Date: 05/26/1999 13:52:41
Bill Studenmund writes:
> On Wed, 26 May 1999, Frederick Bruckman wrote:
> > On Wed, 26 May 1999, John Valdes wrote:
> > > Does NetBSD/mac68k have any tools for analyzing the core files created
> > > by savecore?
> > 
> > I'm not experienced with this, but it can be done with gdb:
> > 
> > (gdb) set target kcore /dev/mem
> > No symbol table is loaded.  Use the "file" command.
> > (gdb) file /netbsd
> 
> "target kcore <corefile>" is right.

That did it, specifically:

  prompt# cd /var/crash
  prompt# ls
  bounds          minfree         netbsd.0        netbsd.0.core
  prompt# gdb
  ...
  (gdb) file netbsd.0
  Reading symbols from netbsd.0...(no debugging symbols found)...done.
  (gdb) target kcore netbsd.0.core
  panic: MMU fault
  #0  0x0 in ?? ()
  (gdb)

but now what?  I can't seem to get any useful information, eg:

  (gdb) backtrace
  #0  0x0 in ?? ()
  (gdb) info registers
  d0             0x0      0
  d1             0x0      0
  d2             0x0      0
  d3             0x0      0
  d4             0x0      0
  d5             0x0      0
  d6             0x0      0
  d7             0x0      0
  a0             0x0      0x0
  a1             0x0      0x0
  a2             0x0      0x0
  a3             0x0      0x0
  a4             0x0      0x0
  a5             0x0      0x0
  fp             0x0      0x0
  sp             0x0      0x0
  ps             0x0      0x0
  pc             0x0      0x0
  fpcontrol      0x0      0x0
  fpstatus       0x0      0x0
  fpiaddr        0x0      0x0
  (gdb) 

On the otherhand, when this panic occurred, and I was dropped into the
kernel debugger, I was able to see a complete backtrace.  I can
trigger a panic and work w/ the kernel debugger, but it'd be
preferable to debug the kernel w/ the system running under X... ;) I
did turn off DEBUG in my kernel conf file; is it just a matter that I
have to turn this on in order in order to get anything useful from the
core file?

FYI, I'm in the process of updating the 1.3 DayStar '030 PowerCache
kernel patch for 1.4.  My first iteration, simplying adjusting the
patch diff file for the new line offsets in the 1.4 source files (and
one minor function call change--for pmap_enter() in mac68k/pmap.c),
seems to work and is pretty stable.  The only instability I've found
so far is when I run perl (5.00404) which I compiled under 1.3, but
core dumps under 1.4 (apparently due to a change in libc.so, even
though the major version number on libc.so in 1.3 and 1.4 hasn't
changed, suggesting that's they're compatible; hmmpf... ;) ).  When
run under the 1.4 GENERIC kernel, perl core dumps; when run under my
DayStar patched 1.4 kernel, the system panics w/ an MMU fault.  I'm
guessing the DayStar's cache needs to be flushed in more places under
1.4 than it did under 1.3, and so I was hoping the stack traces would
tell me where...

John