Terry Lambert wrote:
Debug:
>
[excellent kernel-debugging recipe snipped]

Here's a backtrace of a crashdump that should be more helpful:

Fatal trap 12: page fault while in kernel mode
cpuid = 0; lapic.id = 00000000
fault virtual address = 0x34
fault code = supervisor read, page not present
instruction pointer = 0x8:0xc01b28c6
stack pointer = 0x10:0xeb3b17c0
frame pointer = 0x10:0xeb3b17e0
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 = 2104 (gconf-sanity-check-)
panic: from debugger
cpuid = 0; lapic.id = 00000000


Fatal trap 3: breakpoint instruction fault while in kernel mode
cpuid = 0; lapic.id = 00000000
instruction pointer = 0x8:0xc03019ea
stack pointer = 0x10:0xeb3b1534
frame pointer = 0x10:0xeb3b1540
code segment = base 0x0, limit 0xfffff, type 0x1b
= DPL 0, pres 1, def32 1, gran 1
processor eflags = IOPL = 0
current process = 2104 (gconf-sanity-check-)
panic: from debugger
cpuid = 0; lapic.id = 00000000
boot() called on cpu#0
Uptime: 4m49s
Dumping 1023 MB
16 32 48 64 80 96 112 128 144 160 176 192 208 224 240 256 272 288 304 320 336 352 368 384 400 416 432 448 464 480 496 512 528 544 560 576 592 608 624 640 656 672 688 704 720 736 752 768 784 800 816 832 848 864 880 896 912 928 944 960 976 992 1008
---
#0 doadump () at /usr/src/sys/kern/kern_shutdown.c:240
240 dumpsys(&dumper);

(kgdb) bt
#0 doadump () at /usr/src/sys/kern/kern_shutdown.c:240
#1 0xc01bc00e in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:371
#2 0xc01bc627 in panic (fmt=0xc0349b8d "from debugger")
at /usr/src/sys/kern/kern_shutdown.c:542
#3 0xc0148192 in db_panic () at /usr/src/sys/ddb/db_command.c:448
#4 0xc0147fcc in db_command (last_cmdp=0xc037f9a0, cmd_table=0x0,
aux_cmd_tablep=0xc0376fb8, aux_cmd_tablep_end=0xc0376fbc)
at /usr/src/sys/ddb/db_command.c:346
#5 0xc014820a in db_command_loop () at /usr/src/sys/ddb/db_command.c:470
#6 0xc014af96 in db_trap (type=12, code=0) at /usr/src/sys/ddb/db_trap.c:72
#7 0xc0301697 in kdb_trap (type=12, code=0, regs=0xeb3b1780)
at /usr/src/sys/i386/i386/db_interface.c:166
#8 0xc031a590 in trap_fatal (frame=0xeb3b1780, eva=0)
at /usr/src/sys/i386/i386/trap.c:839
#9 0xc031a2da in trap_pfault (frame=0xeb3b1780, usermode=0, eva=52)
at /usr/src/sys/i386/i386/trap.c:758
#10 0xc0319e95 in trap (frame=
{tf_fs = -1038483432, tf_es = 16, tf_ds = -1070202864, tf_edi = 158, tf_esi = 52, tf_ebp = -348448800, tf_isp = -348448852, tf_ebx = 0, tf_edx = -966573056, tf_ecx = -966602272, tf_eax = -966602272, tf_trapno = 12, tf_err = 0, tf_eip
= -1071961914, tf_cs = 8, tf_eflags = 66178, tf_esp = 0, tf_ss = -1070141731})
at /usr/src/sys/i386/i386/trap.c:445
#11 0xc0302ff8 in calltrap () at {standard input}:97
#12 0xc02098a4 in namei (ndp=0x9e) at /usr/src/sys/kern/vfs_lookup.c:158
#13 0xc021bcfc in vn_open_cred (ndp=0xeb3b1a44, flagp=0xeb3b1a0c, cmode=0,
cred=0xc2195e80) at /usr/src/sys/kern/vfs_vnops.c:185
#14 0xc6acffb4 in ?? ()
#15 0xc01a06b3 in closef (fp=0x2, td=0x0) at vnode_if.h:1225
#16 0xc01a0054 in fdfree (td=0xc662d1e0)
at /usr/src/sys/kern/kern_descrip.c:1433
#17 0xc01a5da2 in exit1 (td=0xc662d1e0) at /usr/src/sys/kern/kern_exit.c:254
#18 0xc01a5b11 in sys_exit () at /usr/src/sys/kern/kern_exit.c:116
#19 0xc031ab56 in syscall (frame=
{tf_fs = 47, tf_es = 47, tf_ds = 47, tf_edi = 0, tf_esi = 11095, tf_ebp =
-1077937128, tf_isp = -348447372, tf_ebx = 679838148, tf_edx = 679837268, tf_ecx = 19, tf_eax = 1, tf_trapno = 12, tf_err = 2, tf_eip = 680166719, tf_cs = 31, tf_eflags = 582, tf_esp = -1077937172, tf_ss = 47})
at /usr/src/sys/i386/i386/trap.c:1033
#20 0xc030304d in Xint0x80_syscall () at {standard input}:139
---Can't read userspace from dump, or kernel process---

(kgdb) up 12
#12 0xc02098a4 in namei (ndp=0x9e) at /usr/src/sys/kern/vfs_lookup.c:158
158 FILEDESC_LOCK(fdp);
(kgdb) list
153 #endif
154
155 /*
156 * Get starting point for the translation.
157 */
158 FILEDESC_LOCK(fdp);
159 ndp->ni_rootdir = fdp->fd_rdir;
160 ndp->ni_topdir = fdp->fd_jdir;
161
162 dp = fdp->fd_cdir;

(kgdb) print ndp
$2 = (struct nameidata *) 0x9e

(kgdb) print fdp
$1 = (struct filedesc *) 0x34
(kgdb)

(kgdb) print p
$3 = (struct proc *) 0x0

(kgdb) print td
$5 = (struct thread *) 0xc662d1e0

(kgdb) print *td
$7 = {td_proc = 0xc66307f0,
[...]

Very strange. namei() does essentially the following:

p = td->td_proc;
fdp = p->p_fd;

td->td_proc seems reasonable, but p is 0. No idea how this could happen, any guesses?

Thanks,
Lars
--
Lars Eggert <[EMAIL PROTECTED]> USC Information Sciences Institute

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to