From owner-freebsd-current@FreeBSD.ORG Thu Nov 3 14:24:51 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CF44616A41F; Thu, 3 Nov 2005 14:24:51 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail5.speedfactory.net [66.23.216.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id D375C43D7C; Thu, 3 Nov 2005 14:24:45 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 1302099 for multiple; Thu, 03 Nov 2005 09:22:44 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.1/8.13.1) with ESMTP id jA3EOXk7065500; Thu, 3 Nov 2005 09:24:33 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-acpi@freebsd.org Date: Thu, 3 Nov 2005 08:57:56 -0500 User-Agent: KMail/1.8.2 References: <436961FD.3040605@root.org> <20051103020902.GA29536@flame.pc> <20051103.114712.74756421.haro@h4.dion.ne.jp> In-Reply-To: <20051103.114712.74756421.haro@h4.dion.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200511030857.58338.jhb@freebsd.org> X-Spam-Status: No, score=-2.8 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=100 Cc: Munehiro Matsuda , jkim@freebsd.org, freebsd-current@freebsd.org, robert.moore@intel.com, keramida@linux.gr Subject: Re: Panic on boot with new ACPI-CA X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Nov 2005 14:24:52 -0000 On Wednesday 02 November 2005 09:47 pm, Munehiro Matsuda wrote: > From: Giorgos Keramidas > Date: Thu, 3 Nov 2005 04:09:02 +0200 > > ::On 2005-11-03 03:47, Giorgos Keramidas wrote: > ::> On 2005-11-02 17:03, Nate Lawson wrote: > ::> > As I mentioned to Jung-uk, the problem is likely an error in > ::> > acpi-ca modifying memory after it has freed it. The way to > ::> > track this down is to enable memguard(9). See the man page for > ::> > info. You need to add options DEBUG_MEMGUARD to your kernel, > ::> > set the malloc type to watch to M_ACPICA, and rebuild your > ::> > kernel and modules. Memguard sets page permissions so we can > ::> > catch the culprit who is modifying the memory. > ::> > ::> This is exactly the messgae printed on my console at panic time > ::> -- of memory modified after free. I'm building a kernel with > ::> MEMGUARD now, but it's probably going to be a bit hard to get a > ::> kernel dump, because the panic happens before disks are available > ::> and I don't have a serial console here. > :: > ::Does the following look ok for using memguard(9) with M_ACPICA? > :: > ::%%% begin acpica-memguard.patch > ::Index: kern/kern_malloc.c > ::=================================================================== > ::RCS file: /home/ncvs/src/sys/kern/kern_malloc.c,v > ::retrieving revision 1.148 > ::diff -u -r1.148 kern_malloc.c > ::--- kern/kern_malloc.c 20 Oct 2005 21:28:31 -0000 1.148 > ::+++ kern/kern_malloc.c 3 Nov 2005 02:04:02 -0000 > ::@@ -62,6 +62,8 @@ > :: #include > :: #include > :: > ::+MALLOC_DECLARE(M_ACPICA); > ::+ > :: #ifdef DEBUG_MEMGUARD > :: #include > :: #endif > ::@@ -305,7 +307,7 @@ > :: > :: #ifdef DEBUG_MEMGUARD > :: /* XXX CHANGEME! */ > ::- if (mtp == M_SUBPROC) > ::+ if (mtp == M_ACPICA) > :: return memguard_alloc(size, flags); > :: #endif > :: > ::%%% end acpica-memguard.patch > > Hi, > > There are few more "CHANGEME!" places. > I used following: > > @@ -64,6 +64,7 @@ > > #ifdef DEBUG_MEMGUARD > #include > +MALLOC_DECLARE(M_ACPICA); > #endif > > #if defined(INVARIANTS) && defined(__i386__) > @@ -305,7 +306,7 @@ > > #ifdef DEBUG_MEMGUARD > /* XXX CHANGEME! */ > - if (mtp == M_SUBPROC) > + if (mtp == M_ACPICA) > return memguard_alloc(size, flags); > #endif > > @@ -360,7 +361,7 @@ > > #ifdef DEBUG_MEMGUARD > /* XXX CHANGEME! */ > - if (mtp == M_SUBPROC) { > + if (mtp == M_ACPICA) { > memguard_free(addr); > return; > } > @@ -424,7 +425,7 @@ > > #ifdef DEBUG_MEMGUARD > /* XXX: CHANGEME! */ > -if (mtp == M_SUBPROC) { > +if (mtp == M_ACPICA) { > slab = NULL; > alloc = size; > } else { Someone should fix it so that the type is a kernel option so you can do: options MEMGUARD=M_ACPICA or some such. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org