From owner-freebsd-questions@FreeBSD.ORG Fri Sep 24 12:42:55 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 277D116A4CE for ; Fri, 24 Sep 2004 12:42:55 +0000 (GMT) Received: from mail.gmx.net (imap.gmx.net [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 330CB43D54 for ; Fri, 24 Sep 2004 12:42:54 +0000 (GMT) (envelope-from ph.schulz@gmx.de) Received: (qmail 16991 invoked by uid 65534); 24 Sep 2004 12:42:52 -0000 Received: from p5090C8C3.dip0.t-ipconnect.de (EHLO [192.168.1.4]) (80.144.200.195) by mail.gmx.net (mp025) with SMTP; 24 Sep 2004 14:42:52 +0200 X-Authenticated: #1954550 Message-ID: <4154164B.1070100@gmx.de> Date: Fri, 24 Sep 2004 14:42:51 +0200 From: Phil Schulz User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.2) Gecko/20040830 X-Accept-Language: de, en-us, en MIME-Version: 1.0 To: "Dan Mahoney, System Admin" References: <20040923152340.O9636@prime.gushi.org> In-Reply-To: <20040923152340.O9636@prime.gushi.org> X-Enigmail-Version: 0.84.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: questions@freebsd.org Subject: Debugging a panic (was: ) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2004 12:42:55 -0000 Dan Mahoney, System Admin wrote: > After recently upgrading to 4.10, on a machine that's known for getting > 100+ days uptime, I got the following error on an unexpected reboot: > [Panic] > > What could cause this? > > -Dan Mahoney > Hi Dan! I'm no expert at all, but I'll give it a try... If you cannot reproduce the panic, you might face a hardware problem. Memory, harddisk, power supply, etc. are the usual suspects. If you, however, can reproduce the panic, please continue to read. Please note that the steps outlined below are things I did on a 5.3-BETA5 system. I might have forgotten some things while I have included other, unneeded steps. There are a few requirements to really debug a panic: * Build a kernel w/ debug symbols. Add "makeoptions DEBUG=-g" to your kernel configuration file. * Set up the "dumpdev" and "dumpdir" variables in rc.conf - mine are set to: dumpdev="/dev/ad0s2b" dumpdir="/var/crash" * If the machine doesn't aim at minimum downtime, you might want to build a kernel debugger into your kernel, so the kernel can drop into the debugger in case of a panic. At the debugger prompt, you can type "backtrace" to get a useful trace on how the kernel ended up in the place where it crashed. I've also found that you need to type "call doadump" to get a crash dump before you can "reset" the machine. This might or might not apply to 4.x, however. * If you're aiming at minimum downtime and have set the machine to automatically reset itself in case of a panic, you'll have to analyze the core dump to get a trace. It is my understanding that the instruction pointer listed in the panic message points to the place where things blew up. You can use the address to point to the line in the source code, provided you have built in debug symbols and you have a core dump. However, the address might point to different places with different kernel configurations, i.e. the adress you gave us only applies to your kernel. I also think that debug symbols do not have any negative impact on performance, so it's a good idea to keep them around. Someone please correct me if I'm wrong. The link below [1] and a quick Google search for "Debugging Kernel Problems" will point you to documentation I've found very useful. HTH, Phil. [1]http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/kerneldebug.html -- Did you know... If you play a Windows 2000 CD backwards, you hear satanic messages, but what's worse is when you play it forward.... ...it installs Windows 2000 -- Alfred Perlstein on chat@freebsd.org