Subject: Re: Help with core dump and gdb
To: None <netbsd-help@NetBSD.org>
From: Paul Newhouse <newhouse@rockhead.com>
List: netbsd-help
Date: 03/11/2007 13:06:55
Running 3.0.1, on i386 (p266, 128MB on AT Twister mobo).

  options     DIAGNOSTIC  # expensive kernel consistency checks
  options     DEBUG       # expensive debugging checks/support
  options     KMEMSTATS   # kernel memory statistics (vmstat -m)
  options     DDB     # in-kernel debugger
  #options    DDB_ONPANIC=1   # see also sysctl(8): `ddb.onpanic'
  options     DDB_HISTORY_SIZE=512    # enable history editing in DDB
  #options    KGDB        # remote debugger
  #options    KGDB_DEVNAME="\"com\"",KGDB_DEVADDR=0x3f8,KGDB_DEVRATE=9600
  makeoptions DEBUG="-g"  # compile full symbol table


>  
>  On Wednesday 07 March 2007 05:14, Paul Newhouse wrote:
>  > I unzip'd some crash files and ran gdb:
...
>  >
>  > Where did I go wrong?
>  
>  You need 
>  
>  	gdb netbsd.6
>  	target kcore netbsd.6.core
>  
>  or if you ever use gdb6
>  
>  	target kvm netbsd.6.core
>  
>  Nick

Thanks.

Several of the crashes have a stack that looks like this:

  (gdb) where
  #0  0x07f00000 in ?? ()
  #1  0xc0457b6f in cpu_reboot ()
  #2  0xc03c24d8 in panic ()
  #3  0xc03d6269 in m_copydata ()
  #4  0xc01a02d8 in pf_route ()
  #5  0xc01a0ecb in pf_test ()
  #6  0xc01ac5fe in pfil4_wrapper ()
  #7  0xc041d8ea in pfil_run_hooks ()
  #8  0xc012bef3 in ip_output ()
  #9  0xc0124ce2 in icmp_send ()
  #10 0xc0124aab in icmp_reflect ()
  #11 0xc01247ab in icmp_input ()
  #12 0xc0125d27 in ip_input ()
  #13 0xc0125756 in ipintr ()
  #14 0xc0102cf9 in Xsoftnet ()

I'm probably doing this wrong but, it looks like the request needs 0x28 bytes
and only finds 0x24 before exhausting what's available?

  (gdb) info frame
  Stack level 3, frame at 0xc096ba48:
   eip = 0xc03d6269 in m_copydata; saved eip 0xc01a02d8
   called by frame at 0xc096bae8, caller of frame at 0xc096ba18
   Arglist at 0xc096ba48, args: 
   Locals at 0xc096ba48, Previous frame's sp in esp
   Saved registers:
    ebx at 0xc096ba3c, ebp at 0xc096ba48, esi at 0xc096ba40, edi at 0xc096ba44,
    eip at 0xc096ba4c

  (gdb) x/8 0xc096ba48
  0xc096ba48:     0xc096bae8      0xc01a02d8      0xc1312e00      0x00000014
  0xc096ba58:     0x00000014      0xc096ba80      0x00000000      0x00000000

  (gdb) x/20 0xc1312e00
  0xc1312e00:     0x00000000      0x00000000      0xca1c380e      0xdeadbeef
  0xc1312e10:     0x00000024      0x09000003      0x01d0ee00      0xdead0001
  0xc1312e20:     0xc0cb9044      0xc10959d0      0x00000024      0x00000000
  0xc1312e30:     0x00000000      0x636e696d      0xca1c3800      0x00000000
  0xc1312e40:     0xc08a2ee0      0x00000800      0x34000045      0xc1312e00


I guess it could be a bit twiddling problem?  Clues on what to follow up
on are appreciated.

Paul