RE: AcpiOsAcquireObject crash [Was: 9-Stable panic: resource_list_unreserve: can't find resource]

2012-11-22 Thread Tom Lislegaard


 -Original Message-
 From: Andriy Gapon [mailto:a...@freebsd.org]
 Sent: 14. november 2012 12:22
 To: Tom Lislegaard
 Cc: freebsd-acpi@FreeBSD.org
 Subject: Re: AcpiOsAcquireObject crash [Was: 9-Stable panic: 
 resource_list_unreserve: can't find
 resource]
 
 on 13/11/2012 17:14 Andriy Gapon said the following:
  I have a better patch, which I tested at least.  I'll send it to you 
  soon-ish.
 
 Here is a tested version of the ref-count patch (still a little bit 
 experimental):
 http://people.freebsd.org/~avg/acpi-ref-count-exp.diff
 
 --
 Andriy Gapon

I've had the patched kernel running for nearly one week without any panic or 
other acpi related problems so I think it's safe to say this patch is good. 
Thanks.

Any idea when this (and the previous patch for the resource_list_unreserve 
problem) can be committed? I suppose it will have to be sometime after 
9.1-RELEASE?

-tom

___
freebsd-acpi@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-acpi
To unsubscribe, send any mail to freebsd-acpi-unsubscr...@freebsd.org


Re: AcpiOsAcquireObject crash [Was: 9-Stable panic: resource_list_unreserve: can't find resource]

2012-11-14 Thread Andriy Gapon
on 13/11/2012 17:14 Andriy Gapon said the following:
 I have a better patch, which I tested at least.  I'll send it to you soon-ish.

Here is a tested version of the ref-count patch (still a little bit 
experimental):
http://people.freebsd.org/~avg/acpi-ref-count-exp.diff

-- 
Andriy Gapon
___
freebsd-acpi@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-acpi
To unsubscribe, send any mail to freebsd-acpi-unsubscr...@freebsd.org


RE: AcpiOsAcquireObject crash [Was: 9-Stable panic: resource_list_unreserve: can't find resource]

2012-11-13 Thread Tom Lislegaard


 -Original Message-
 From: Andriy Gapon [mailto:a...@freebsd.org]
 Sent: 9. november 2012 14:46
 To: Tom Lislegaard
 Cc: freebsd-acpi@FreeBSD.org
 Subject: Re: AcpiOsAcquireObject crash [Was: 9-Stable panic: 
 resource_list_unreserve: can't find
 resource]
 
 on 09/11/2012 14:17 Tom Lislegaard said the following:
  kgdb) up 7
  #7  0x802d1bdd in AcpiOsAcquireObject (Cache=0xfe00052bac60) at
 /usr/src/sys/contrib/dev/acpica/utilities/utcache.c:316
  316 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
  (kgdb) x/9a Cache-ListHead
  0xfffeec85c730: Cannot access memory at address 0xfffeec85c730
 
 [Slaps forehead] Ah, right, indeed.on
 I guess the problem hasn't happened again since then?
 Does the patch appear to work OK so far (with respect to the original 
 problem)?

You're right, I haven't had any occurrence of the 'resource_list_unreserve' 
panic since the original patch.

The patch below works badly on my system. I notice that certain processes start 
to hang, for instance during boot I have to interrupt /etc/rc.d/initrandom to 
continue. Xorg also hangs and if I log in on another terminal I see the process 
is in processorstate 'acmtx'. 

The kernel msg buffer is full of messages like this

ACPI Error: Could not acquire AML Interpreter mutex (20110527/exutils-107)
ACPI Exception: AE_ERROR, Thread 100076 could not acquire Mutex [0x8] 
(20110527/utmutex-315)
ACPI Error: Mutex [0x8] is not acquired, cannot release (20110527/utmutex-359)
ACPI Error: Mutex [0x0] is not acquired, cannot release (20110527/utmutex-359)
ACPI Error: Could not release AML Interpreter mutex (20110527/exutils-177)

-tom

 I have a suspicion about what causes the new problem.
 If it is correct then the following experimental patch may help with it:
 
 --- a/sys/contrib/dev/acpica/components/utilities/utdelete.c
 +++ b/sys/contrib/dev/acpica/components/utilities/utdelete.c
 @@ -415,6 +415,8 @@ AcpiUtUpdateRefCount (
  return;
  }
 
 +(void) AcpiUtAcquireMutex (ACPI_MTX_REFCOUNTS);
 +
  Count = Object-Common.ReferenceCount;
  NewCount = Count;
 
 @@ -490,6 +492,8 @@ AcpiUtUpdateRefCount (
  ACPI_WARNING ((AE_INFO,
  Large Reference Count (0x%X) in object %p, Count, Object));
  }
 +
 +(void) AcpiUtReleaseMutex (ACPI_MTX_REFCOUNTS);
  }
 
 
 
 --- a/sys/contrib/dev/acpica/include/aclocal.h
 +++ b/sys/contrib/dev/acpica/include/aclocal.h
 @@ -89,8 +89,9 @@ union acpi_parse_object;
  #define ACPI_MTX_MEMORY 5   /* Debug memory tracking lists */
  #define ACPI_MTX_DEBUG_CMD_COMPLETE 6   /* AML debugger */
  #define ACPI_MTX_DEBUG_CMD_READY7   /* AML debugger */
 +#define ACPI_MTX_REFCOUNTS  8   /* ACPI object reference counts 
 */
 
 -#define ACPI_MAX_MUTEX  7
 +#define ACPI_MAX_MUTEX  8
  #define ACPI_NUM_MUTEX  ACPI_MAX_MUTEX+1
 
 
 
 --
 Andriy Gapon


___
freebsd-acpi@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-acpi
To unsubscribe, send any mail to freebsd-acpi-unsubscr...@freebsd.org


Re: AcpiOsAcquireObject crash [Was: 9-Stable panic: resource_list_unreserve: can't find resource]

2012-11-09 Thread Andriy Gapon
on 09/11/2012 14:17 Tom Lislegaard said the following:
 kgdb) up 7
 #7  0x802d1bdd in AcpiOsAcquireObject (Cache=0xfe00052bac60) at 
 /usr/src/sys/contrib/dev/acpica/utilities/utcache.c:316
 316   ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
 (kgdb) x/9a Cache-ListHead
 0xfffeec85c730:   Cannot access memory at address 0xfffeec85c730

[Slaps forehead] Ah, right, indeed.
I guess the problem hasn't happened again since then?
Does the patch appear to work OK so far (with respect to the original problem)?

I have a suspicion about what causes the new problem.
If it is correct then the following experimental patch may help with it:

--- a/sys/contrib/dev/acpica/components/utilities/utdelete.c
+++ b/sys/contrib/dev/acpica/components/utilities/utdelete.c
@@ -415,6 +415,8 @@ AcpiUtUpdateRefCount (
 return;
 }

+(void) AcpiUtAcquireMutex (ACPI_MTX_REFCOUNTS);
+
 Count = Object-Common.ReferenceCount;
 NewCount = Count;

@@ -490,6 +492,8 @@ AcpiUtUpdateRefCount (
 ACPI_WARNING ((AE_INFO,
 Large Reference Count (0x%X) in object %p, Count, Object));
 }
+
+(void) AcpiUtReleaseMutex (ACPI_MTX_REFCOUNTS);
 }



--- a/sys/contrib/dev/acpica/include/aclocal.h
+++ b/sys/contrib/dev/acpica/include/aclocal.h
@@ -89,8 +89,9 @@ union acpi_parse_object;
 #define ACPI_MTX_MEMORY 5   /* Debug memory tracking lists */
 #define ACPI_MTX_DEBUG_CMD_COMPLETE 6   /* AML debugger */
 #define ACPI_MTX_DEBUG_CMD_READY7   /* AML debugger */
+#define ACPI_MTX_REFCOUNTS  8   /* ACPI object reference counts */

-#define ACPI_MAX_MUTEX  7
+#define ACPI_MAX_MUTEX  8
 #define ACPI_NUM_MUTEX  ACPI_MAX_MUTEX+1



-- 
Andriy Gapon
___
freebsd-acpi@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-acpi
To unsubscribe, send any mail to freebsd-acpi-unsubscr...@freebsd.org


AcpiOsAcquireObject crash [Was: 9-Stable panic: resource_list_unreserve: can't find resource]

2012-11-08 Thread Andriy Gapon
on 08/11/2012 18:11 Tom Lislegaard said the following:
 I've put up some more info 
 https://dl.dropbox.com/u/13263820/vmcore_7.txt
 
 BTW, what version of FreeBSD do you use?
 
 Version is RELENG_9 checked out ~3 days ago
 
 What ACPICA version is there (debug.acpi.acpi_ca_version) ?
 
 debug.acpi.acpi_ca_version: 20110527

Thanks!
Could you please also do:
x/9a Cache-ListHead
?

I suspect that this bug is of very inconvenient nature: a memory corruption,
either semi-random or some sort of use after free.

-- 
Andriy Gapon
___
freebsd-acpi@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-acpi
To unsubscribe, send any mail to freebsd-acpi-unsubscr...@freebsd.org