From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 7 19:24:49 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCC1D106566B for ; Wed, 7 Sep 2011 19:24:49 +0000 (UTC) (envelope-from crmartin@sgi.com) Received: from relay.sgi.com (relay2.sgi.com [192.48.179.30]) by mx1.freebsd.org (Postfix) with ESMTP id 917708FC14 for ; Wed, 7 Sep 2011 19:24:49 +0000 (UTC) Received: from xmail.sgi.com (pv-excas3-dc21-nlb.corp.sgi.com [137.38.102.207]) by relay2.corp.sgi.com (Postfix) with ESMTP id B6EDA304071; Wed, 7 Sep 2011 12:24:48 -0700 (PDT) Received: from [10.3.0.220] (10.3.0.220) by xmail.sgi.com (137.38.102.30) with Microsoft SMTP Server (TLS) id 14.1.289.1; Wed, 7 Sep 2011 14:24:35 -0500 Message-ID: <4E67C4E6.40009@sgi.com> Date: Wed, 7 Sep 2011 13:24:22 -0600 From: Charlie Martin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.21) Gecko/20110831 Lightning/1.0b2 Thunderbird/3.1.13 MIME-Version: 1.0 To: References: <4E67B323.8000602@sgi.com> In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.3.0.220] Cc: freebsd-hackers@freebsd.org Subject: Re: Understanding panic and exit in the kernel X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Sep 2011 19:24:49 -0000 On 2011-09-07 12:53, mdf@FreeBSD.org wrote: >> For my immediate purposes, I'd be happy with any way in which I could >> > brutally kill the kernel and force it to the debugger, say by replacing the >> > panic call with a printf followed by "1/0;". But I'm a little confused by >> > the panic.c code -- it prints the arguments using a var_args, and then calls >> > "exit(1);' > What file are you looking in? The kernel panic() is in > sys/kern/kern_shutdown.c, not sys/boot/common/panic.c. It will > optionally call kdb_enter_why() and then boot(). Bingo, that's got to help. This makes a lot more sense. > Do you have the debug.debugger_on_panic sysctl set to 1? Yes -- and panic does so *except* in the version with those changes to queue.h. > Thanks, > matthew > -- Charles R. (Charlie) Martin Senior Software Engineer SGI logo 1900 Pike Road Longmont, CO 80501 Phone: 303-532-0209 E-Mail: CRMartin@sgi.com Website: www.sgi.com