From owner-cvs-src@FreeBSD.ORG Thu Sep 9 20:44:38 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6088216A4CE for ; Thu, 9 Sep 2004 20:44:38 +0000 (GMT) Received: from mail6.speakeasy.net (mail6.speakeasy.net [216.254.0.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id 200CD43D49 for ; Thu, 9 Sep 2004 20:44:38 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 32138 invoked from network); 9 Sep 2004 20:44:37 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 9 Sep 2004 20:44:37 -0000 Received: from [10.50.40.210] (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id i89KiYSE009795; Thu, 9 Sep 2004 16:44:34 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: src-committers@FreeBSD.org Date: Thu, 9 Sep 2004 16:44:14 -0400 User-Agent: KMail/1.6.2 References: <200409092039.i89KdV1P025377@repoman.freebsd.org> In-Reply-To: <200409092039.i89KdV1P025377@repoman.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200409091644.14776.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: cvs-src@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/i386/i386 db_trace.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2004 20:44:38 -0000 On Thursday 09 September 2004 04:39 pm, John Baldwin wrote: > jhb 2004-09-09 20:39:31 UTC > > FreeBSD src repository > > Modified files: > sys/i386/i386 db_trace.c > Log: > Teach the stack trace code how to step across a double fault when > stepping across frames. Basically, if the current frame is for the > 'dblfault_handler' function, then get the next %eip and %ebp values to > use from the original TSS of the thread that has the saved state when the > double fault triggered. > > MFC after: 4 days Example output: Enter full pathname of shell or RETURN for /bin/sh: # kldload crash # sysctl debug.crash debug.crash.test: 0 # sysctl debug.crash.test=20 debug.crash.test: 0crash: blow the kernel stack on purpose Fatal double fault: eip = 0xc217c859 esp = 0xdfe52e80 ebp = 0xdfe53080 cpuid = 2; apic id = 02 panic: double fault cpuid = 2 KDB: enter: panic [thread 100096] Stopped at kdb_enter+0x30: leave db> tra kdb_enter(c0715078,2,c0730329,c07c3928,c215ab00) at kdb_enter+0x30 panic(c0730329,2,0,0,0) at panic+0x150 dblfault_handler() at dblfault_handler+0x8c --- trap 0x17, eip = 0xc217c859, esp = 0xdfe52e80, ebp = 0xdfe53080 --- blow_stack(0,0,0,0,0) at blow_stack+0x9 blow_stack(0,0,0,0,0) at blow_stack+0xe blow_stack(0,0,0,0,0) at blow_stack+0xe blow_stack(0,0,0,0,0) at blow_stack+0xe blow_stack(0,0,0,0,0) at blow_stack+0xe blow_stack(0,0,0,0,0) at blow_stack+0xe blow_stack(0,0,0,0,0) at blow_stack+0xe blow_stack(0,0,0,0,0) at blow_stack+0xe blow_stack(0,0,0,0,0) at blow_stack+0xe blow_stack(0,0,0,0,0) at blow_stack+0xe blow_stack(0,0,0,0,0) at blow_stack+0xe blow_stack(0,0,0,0,0) at blow_stack+0xe blow_stack(0,0,0,0,0) at blow_stack+0xe blow_stack(c0711a9c,1b3,0,c215ab00,1c200) at blow_stack+0xe blow_stack(c217dbb5,c217db60,c217db94,88,c2159c40) at blow_stack+0xe crash_thread(0,dfe54d48,c07127ef,328,c215ab00) at crash_thread+0xd86 fork_exit(c217c870,0,dfe54d48) at fork_exit+0xc6 fork_trampoline() at fork_trampoline+0x8 --- trap 0x1, eip = 0, esp = 0xdfe54d7c, ebp = 0 --- db> Previously the stack trace would have just stopped at the 'dblfault_handler' line. This should help with debugging double faults (which are usually due to an exhausted kernel stack) which have been a pain in the past. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org