ACPI panic

Andriy Gapon avg at FreeBSD.org
Thu Nov 22 10:24:58 UTC 2012


on 22/11/2012 10:18 Stefan Farfeleder said the following:
> I'm afraid the AcpiOsAcquireObject panic is not directly related to
> reference counting. I had the very same panic today with your patch.

OK, let's try to attack it from a different angle.
Please try this patch:
diff --git a/sys/contrib/dev/acpica/components/utilities/utcache.c
b/sys/contrib/dev/acpica/components/utilities/utcache.c
index b8efa68..a3d964a 100644
--- a/sys/contrib/dev/acpica/components/utilities/utcache.c
+++ b/sys/contrib/dev/acpica/components/utilities/utcache.c
@@ -226,6 +226,22 @@ 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) {
+            ACPI_ERROR ((AE_INFO, "freeing a free object %p\n", Object));
+            Curr = *(volatile char **)NULL; /* induce crash */
+        }
+    }
+    (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES);
+
     /* If cache is full, just free this object */

     if (Cache->CurrentDepth >= Cache->MaxDepth)


-- 
Andriy Gapon


More information about the freebsd-acpi mailing list