Date: Mon, 04 Feb 2008 10:18:54 -0500 From: Stephen Clark <Stephen.Clark@seclark.us> To: freebsd-stable@freebsd.org Subject: debugging 6.1 crash Message-ID: <47A72CDE.20101@seclark.us>
next in thread | raw e-mail | index | archive | help
Hello List, I am trying to debug a 6.1 panic. When I run kgdb kernel.debug /var/crash/vmcore.7 all I get is: kgdb: kvm_read: invalid address (0x24) kgdb: kvm_read: invalid address (0x24) kgdb: kvm_read: invalid address (0x24) kgdb: kvm_read: invalid address (0x24) kgdb: kvm_read: invalid address (0x24) kgdb: kvm_read: invalid address (0x24) kgdb: kvm_read: invalid address (0x24) ... the info file shows: Dump header from device /dev/ad0s1b Architecture: i386 Architecture Version: 2 Dump Length: 116981760B (111 MB) Blocksize: 512 Dumptime: Mon Feb 4 04:13:09 2008 Hostname: G301482.netws.com Magic: FreeBSD Kernel Dump Version String: FreeBSD 6.1-STABLE #25: Wed Nov 14 10:30:01 EST 2007 root@J301002.nwv01.com:/mnt/src/sys/i386/compile/WOLFPAC6SMP Panic String: page fault Dump Parity: 1156397610 Bounds: 7 Dump Status: good Does my kernel.debug have to match exactly the crash file kernel. I have made the following change to my kernel that the kernel.debug is based on. --- route.h.orig Tue Apr 4 22:07:23 2006 +++ route.h Mon Dec 17 13:11:44 2007 @@ -289,6 +289,7 @@ #define RT_LOCK_INIT(_rt) \ mtx_init(&(_rt)->rt_mtx, "rtentry", NULL, MTX_DEF | MTX_DUPOK) #define RT_LOCK(_rt) mtx_lock(&(_rt)->rt_mtx) +#define RT_TRYLOCK(_rt) mtx_trylock(&(_rt)->rt_mtx) #define RT_UNLOCK(_rt) mtx_unlock(&(_rt)->rt_mtx) #define RT_LOCK_DESTROY(_rt) mtx_destroy(&(_rt)->rt_mtx) #define RT_LOCK_ASSERT(_rt) mtx_assert(&(_rt)->rt_mtx, MA_OWNED) --- route.c.orig Tue Oct 30 19:07:54 2007 +++ route.c Mon Dec 17 15:13:20 2007 @@ -996,6 +996,7 @@ struct radix_node_head *rnh = rt_tables[dst->sa_family]; int dlen = SA_SIZE(dst), glen = SA_SIZE(gate); +again: RT_LOCK_ASSERT(rt); /* @@ -1029,7 +1030,15 @@ RT_REMREF(rt); return (EADDRINUSE); /* failure */ } - RT_LOCK(rt); + /* + * Try to reacquire the lock on rt, and if it fails, + * clean state and restart from scratch. + */ + if (!RT_TRYLOCK(rt)) { + RTFREE_LOCKED(gwrt); + RT_LOCK(rt); + goto again; + } /* * If there is already a gwroute, then drop it. If we * are asked to replace route with itself, then do Thanks, Steve -- "They that give up essential liberty to obtain temporary safety, deserve neither liberty nor safety." (Ben Franklin) "The course of history shows that as a government grows, liberty decreases." (Thomas Jefferson)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?47A72CDE.20101>