Netgraph node, first steps in kernel land and a bloody crash dump

Paolo Pisati p.pisati at oltrelinux.com
Thu Jul 31 14:13:14 PDT 2003


Hi guys, 

still here with my netgraph node.

Today, after a couple of nice days without a problem,
i spent the last 4 hours trying to understand why the hell,
my module crash my stable box.

DISCLAIMER: this is my first real attempt to work
in kernel land, so it's quite possibile that i did
something so stupid to not recognize it... =P

anyway, this is a crash dump:

(kgdb) exec-file /var/crash/kernel.0
(kgdb) core-file /var/crash/vmcore.0
IdlePTD at phsyical address 0x0033c000
initial pcb at physical address 0x0026bb20
panicstr: page fault
panic messages:
---
Fatal trap 12: page fault while in kernel mode
fault virtual address   = 0x310
fault code              = supervisor read, page not present
instruction pointer     = 0x8:0x310
stack pointer           = 0x10:0xccf7ece4
frame pointer           = 0x10:0xccf7ecf0
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, def32 1, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 620 (thesis)
interrupt mask          =
trap number             = 12
panic: page fault
syncing disks... 13 1
done
Uptime: 13m29s
dumping to dev #ad/0x20001, offset 230752
dump ata0: resetting devices .. done
128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109
108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85
 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 5
8 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3
2 1
---
#0  dumpsys () at /usr/src/sys/kern/kern_shutdown.c:487
487             if (dumping++) {
(kgdb) where
#0  dumpsys () at /usr/src/sys/kern/kern_shutdown.c:487
#1  0xc0157b9f in boot (howto=256) at /usr/src/sys/kern/kern_shutdown.c:316
#2  0xc0157fc4 in poweroff_wait (junk=0xc023f64c, howto=-1071386289)
    at /usr/src/sys/kern/kern_shutdown.c:595
#3  0xc02056a6 in trap_fatal (frame=0xccf7eca4, eva=784)
    at /usr/src/sys/i386/i386/trap.c:974
#4  0xc0205379 in trap_pfault (frame=0xccf7eca4, usermode=0, eva=784)
    at /usr/src/sys/i386/i386/trap.c:867
#5  0xc0204f63 in trap (frame={tf_fs = 16, tf_es = 16, tf_ds = 16,
      tf_edi = -856166976, tf_esi = 0, tf_ebp = -856167184,
      tf_isp = -856167216, tf_ebx = 69, tf_edx = 0, tf_ecx = 0,
      tf_eax = -6422529, tf_trapno = 12, tf_err = 0, tf_eip = 784, tf_cs = 8,
      tf_eflags = 66118, tf_esp = -1071208512, tf_ss = 1861})
    at /usr/src/sys/i386/i386/trap.c:466
#6  0x310 in ?? ()
#7  0xc0163e70 in putchar (c=69, arg=0xccf7edc0)
    at /usr/src/sys/kern/subr_prf.c:355
#8  0xc0164086 in kvprintf (fmt=0xc0e24baa "AF NODE\n",
    func=0xc0163dd0 <putchar>, arg=0xccf7edc0, radix=10, ap=0xccf7edd8 "")
    at /usr/src/sys/kern/subr_prf.c:532
#9  0xc0163d4c in printf (fmt=0xc0e24ba8 "LEAF NODE\n")
    at /usr/src/sys/kern/subr_prf.c:305
#10 0xc0e2348a in ?? ()
#11 0xc0e23354 in ?? ()
#12 0xc019bc15 in ng_send_data (hook=0xc0cf4a40, m=0xc0748d00, meta=0x0)
    at /usr/src/sys/netgraph/ng_base.c:1649
#13 0xc0de12be in ?? ()
#14 0xc01769e3 in sosend (so=0xcc6e0580, addr=0xc0bc44c0, uio=0xccf80ed8,
    top=0xc0748d00, control=0x0, flags=0, p=0xc7bd9080)
    at /usr/src/sys/kern/uipc_socket.c:609
#15 0xc0179e27 in sendit (p=0xc7bd9080, s=4, mp=0xccf80f18, flags=0)
    at /usr/src/sys/kern/uipc_syscalls.c:590
#16 0xc0179ee6 in sendto (p=0xc7bd9080, uap=0xccf80f80)
    at /usr/src/sys/kern/uipc_syscalls.c:643
#17 0xc02058ca in syscall2 (frame={tf_fs = 47, tf_es = 47, tf_ds = 47,
      tf_edi = -1077937886, tf_esi = 671679608, tf_ebp = -1077937864,
      tf_isp = -856158252, tf_ebx = 671679968, tf_edx = 134565966,
      tf_ecx = -9, tf_eax = 133, tf_trapno = 0, tf_err = 2,
      tf_eip = 671912972, tf_cs = 31, tf_eflags = 643, tf_esp = -1077937956,
      tf_ss = 47}) at /usr/src/sys/i386/i386/trap.c:1175
#18 0xc01f9615 in Xint0x80_syscall ()
#19 0x80522c4 in ?? ()
#20 0x80523b0 in ?? ()
#22 0x805251a in ?? ()
#23 0x805251a in ?? ()
#24 0x805251a in ?? ()
#25 0x805251a in ?? ()
#26 0x80495ce in ?? ()
#27 0x8048ada in ?? ()

Ok, i'm not a guru, but it looks like the culprit is printf in kernel
land, or at least, a bad use of it from myself... (see #9).

I would like to fill the missing ?? in this dump, but i couldn't
find how to load the symbols from my node (and yes, i've
tried what's written in the handbook about the modules and
it didn't work).

Ok, enough for today, i wish someone could shed some
light here, cause i really gave up... =(

on a side note: 
[flag at newluxor flag]$ man 9 printf
No entry for printf in section 9 of the manual
[flag at newluxor flag]$

what's happened to the man page?

thank you.

-- 

Paolo

GUFI: http://www.gufi.org



More information about the freebsd-net mailing list