From owner-freebsd-acpi@FreeBSD.ORG Sun Nov 25 14:00:17 2012 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E697FEAF; Sun, 25 Nov 2012 14:00:17 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep17.mx.upcmail.net (fep17.mx.upcmail.net [62.179.121.37]) by mx1.freebsd.org (Postfix) with ESMTP id F13D88FC0C; Sun, 25 Nov 2012 14:00:16 +0000 (UTC) Received: from edge03.upcmail.net ([192.168.13.238]) by viefep17-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20121125140009.XBEQ7658.viefep17-int.chello.at@edge03.upcmail.net>; Sun, 25 Nov 2012 15:00:09 +0100 Received: from mole.fafoe.narf.at ([80.109.55.137]) by edge03.upcmail.net with edge id Tq091k00D2xdvHc03q09Zm; Sun, 25 Nov 2012 15:00:09 +0100 X-SourceIP: 80.109.55.137 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id DCD816D449; Sun, 25 Nov 2012 15:00:08 +0100 (CET) Date: Sun, 25 Nov 2012 15:00:08 +0100 From: Stefan Farfeleder To: Andriy Gapon Subject: Re: ACPI panic Message-ID: <20121125140008.GA1497@mole.fafoe.narf.at> References: <20121120103522.GB2012@mole.fafoe.narf.at> <50AC0A68.8070906@FreeBSD.org> <20121121104840.GA1468@mole.fafoe.narf.at> <20121122081831.GA1483@mole.fafoe.narf.at> <50ADFD75.10709@FreeBSD.org> <50ADFFB2.1000108@FreeBSD.org> <50AE057D.8060808@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50AE057D.8060808@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-acpi@FreeBSD.org X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Nov 2012 14:00:18 -0000 Hi Andriy, with your patch my notebook has a ~50% chance of stalling during boot. This always happens after the "Entropy harvesting" line and I can only power it down then. I guess somehow cycles are introduced into the acpi objects list? The panic was never triggered. Stefan On Thu, Nov 22, 2012 at 12:59:09PM +0200, Andriy Gapon wrote: > > A patch that should actually compile, finally. > BTW, it's probably better to replace the NULL dereference trick with a simple > panic call in the first patch too. > > diff --git a/sys/contrib/dev/acpica/components/utilities/utcache.c > b/sys/contrib/dev/acpica/components/utilities/utcache.c > index b8efa68..edd9e4f 100644 > --- a/sys/contrib/dev/acpica/components/utilities/utcache.c > +++ b/sys/contrib/dev/acpica/components/utilities/utcache.c > @@ -226,6 +226,21 @@ AcpiOsReleaseObject ( > return (AE_BAD_PARAMETER); > } > > + (void) AcpiUtAcquireMutex (ACPI_MTX_CACHES); > + char *Curr; > + char *Next; > + Next = Cache->ListHead; > + while (Next) > + { > + Curr = Next; > + Next = *(ACPI_CAST_INDIRECT_PTR (char, > + &(((char *) Curr)[Cache->LinkOffset]))); > + if (Object == Curr) { > + panic("freeing a free object %p", Object); > + } > + } > + (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES); > + > /* If cache is full, just free this object */ > > if (Cache->CurrentDepth >= Cache->MaxDepth) > @@ -312,6 +327,10 @@ AcpiOsAcquireObject ( > > Cache->CurrentDepth--; > > + if (*(const unsigned char *) Object != 0xCA) { > + panic("detected use after free %p\n", Object); > + } > + > ACPI_MEM_TRACKING (Cache->Hits++); > ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, > "Object %p from %s cache\n", Object, Cache->ListName)); > > -- > Andriy Gapon > _______________________________________________ > freebsd-acpi@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-acpi > To unsubscribe, send any mail to "freebsd-acpi-unsubscribe@freebsd.org"