Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Mar 2001 19:11:09 -0600
From:      Mike Meyer <mwm@mired.org>
To:        Trevin Chow <trevin@mail.com>
Cc:        questions@freebsd.org
Subject:   Re: Trying to debug my kernel -- but lost :)
Message-ID:  <15016.11693.821136.686569@guru.mired.org>
In-Reply-To: <97072546@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Trevin Chow <trevin@mail.com> types:
> Hi guys,
> 
> I'm trying to follow the directions in the FreeBSD handbook about debugging 
> the kernel using my dumped core with gbd, but I'm totally lost :)
> 
> I followed the directions about entering "symbol-file kernel.debug", 
> "exec-file /var/crash/kernel.0" and "exec-file /var/crash/vmcore.0".  Now 
> I'm in gdb with no idea what to do.. I've never debugged with gdb and I 
> have no clue where to go from here.... this is all a little beyond me :)

Well the 'help' command in gdb provides a lot of information. Given
that you can't really run the kernel, you have to settle for examining
the code and the system state at the time it was running.

> Here's the output from my session:

That one is documented in the crash man page. Your file system is
corrupt. That's either the result of an earlier crash, or a hardware
failure. Making sure you do an fsck should fix this problem.

	<mike

> -------------------------------------
> 
> (/sys/compile/BENNY)--# gdb -k
> 
> (kgdb) symbol-file kernel.debug
> Reading symbols from kernel.debug...done.
> (kgdb) exec-file /var/crash/kernel.0
> (kgdb) core-file /var/crash/vmcore.0
> IdlePTD 2830336
> initial pcb at 2380e0
> panicstr: ffs_valloc: dup alloc
> panic messages:
> ---
> panic: ffs_valloc: dup alloc
> 
> syncing disks... 119 117 91 61 28 7
> done
> Uptime: 1d18h32m12s
> 
> dumping to dev #ad/0x20001, offset 163840
> dump ata0: resetting devices .. done
> 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 ../../kern/kern_shutdown.c:469
> 469             if (dumping++) {
> (kgdb) where
> #0  dumpsys () at ../../kern/kern_shutdown.c:469
> #1  0xc01392ef in boot (howto=256) at ../../kern/kern_shutdown.c:309
> #2  0xc013966c in poweroff_wait (junk=0xc0208621, howto=-1071610368) at 
> ../../kern/kern_shutdown.c:556
> #3  0xc0196bc4 in ffs_valloc (pvp=0xc4f3ed40, mode=33133, cred=0xc0a57000, 
> vpp=0xc4feaca4) at ../../ufs/ffs/ffs_alloc.c:609
> #4  0xc01a8fc3 in ufs_makeinode (mode=33133, dvp=0xc4f3ed40, 
> vpp=0xc4feaee0, cnp=0xc4feaef4) at ../../ufs/ufs/ufs_vnops.c:2082
> #5  0xc01a6978 in ufs_create (ap=0xc4feae00) at ../../ufs/ufs/ufs_vnops.c:184
> #6  0xc01a917d in ufs_vnoperate (ap=0xc4feae00) at 
> ../../ufs/ufs/ufs_vnops.c:2287
> #7  0xc016bdd8 in vn_open (ndp=0xc4feaecc, fmode=1550, cmode=365) at 
> vnode_if.h:106
> #8  0xc0168004 in open (p=0xc4f8e8e0, uap=0xc4feaf80) at 
> ../../kern/vfs_syscalls.c:995
> #9  0xc01e7a29 in syscall2 (frame={tf_fs = 47, tf_es = 47, tf_ds = 47, 
> tf_edi = 134817981, tf_esi = 27, tf_ebp = -1077937464,
>        tf_isp = -989941804, tf_ebx = 1549, tf_edx = 27, tf_ecx = -30, 
> tf_eax = 5, tf_trapno = 7, tf_err = 2, tf_eip = 134680024,
>        tf_cs = 31, tf_eflags = 518, tf_esp = -1077937828, tf_ss = 47}) at 
> ../../i386/i386/trap.c:1150
> #10 0xc01dc4a5 in Xint0x80_syscall ()
> #11 0x8050a1d in ?? ()
> #12 0x8052da2 in ?? ()
> #13 0x8048135 in ?? ()
> (kgdb)
> 
> --------------------------
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
> 
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15016.11693.821136.686569>