Re: MacBookPro 5,1

2010-11-05 Thread Jung-uk Kim
On Tuesday 12 October 2010 06:09 am, Hans Petter Selasky wrote: Hi, My MacBookPro 5,1 does not boot using -current because memory inside the ACPI kernel module is used after free. The following patch temporily mitigates the problem: /usr/src/sys/dev/acpica/Osd/OsdMemory.c void

Re: MacBookPro 5,1

2010-11-05 Thread Jung-uk Kim
On Friday 05 November 2010 04:14 pm, Jung-uk Kim wrote: On Tuesday 12 October 2010 06:09 am, Hans Petter Selasky wrote: Hi, My MacBookPro 5,1 does not boot using -current because memory inside the ACPI kernel module is used after free. The following patch temporily mitigates the

RE: MacBookPro 5,1

2010-11-04 Thread Moore, Robert
Petter Selasky'; Jung-uk Kim; freebsd-acpi@freebsd.org Subject: RE: MacBookPro 5,1 You cannot assume that a full memcpy has been performed on the structure when you invoke the equals operator. This is basic C -Original Message- From: owner-freebsd-a...@freebsd.org [mailto:owner-freebsd

Re: MacBookPro 5,1

2010-11-03 Thread John Baldwin
On Tuesday, November 02, 2010 6:32:12 pm Jung-uk Kim wrote: On Tuesday 02 November 2010 05:26 pm, John Baldwin wrote: On Tuesday, November 02, 2010 4:50:18 pm Jung-uk Kim wrote: On Tuesday 02 November 2010 04:24 pm, John Baldwin wrote: On Tuesday, November 02, 2010 4:14:05 pm Jung-uk Kim

Re: MacBookPro 5,1

2010-11-03 Thread Jung-uk Kim
On Wednesday 03 November 2010 08:28 am, John Baldwin wrote: On Tuesday, November 02, 2010 6:32:12 pm Jung-uk Kim wrote: On Tuesday 02 November 2010 05:26 pm, John Baldwin wrote: On Tuesday, November 02, 2010 4:50:18 pm Jung-uk Kim wrote: On Tuesday 02 November 2010 04:24 pm, John Baldwin

Re: MacBookPro 5,1

2010-11-03 Thread John Baldwin
On Wednesday, November 03, 2010 12:25:37 pm Jung-uk Kim wrote: On Wednesday 03 November 2010 08:28 am, John Baldwin wrote: On Tuesday, November 02, 2010 6:32:12 pm Jung-uk Kim wrote: On Tuesday 02 November 2010 05:26 pm, John Baldwin wrote: On Tuesday, November 02, 2010 4:50:18 pm

Re: MacBookPro 5,1

2010-11-03 Thread Jung-uk Kim
On Wednesday 03 November 2010 12:47 pm, John Baldwin wrote: On Wednesday, November 03, 2010 12:25:37 pm Jung-uk Kim wrote: On Wednesday 03 November 2010 08:28 am, John Baldwin wrote: On Tuesday, November 02, 2010 6:32:12 pm Jung-uk Kim wrote: On Tuesday 02 November 2010 05:26 pm, John

Re: MacBookPro 5,1

2010-11-03 Thread Jung-uk Kim
On Wednesday 03 November 2010 01:51 pm, Jung-uk Kim wrote: On Wednesday 03 November 2010 12:47 pm, John Baldwin wrote: On Wednesday, November 03, 2010 12:25:37 pm Jung-uk Kim wrote: On Wednesday 03 November 2010 08:28 am, John Baldwin wrote: On Tuesday, November 02, 2010 6:32:12 pm

Re: MacBookPro 5,1

2010-11-03 Thread Andriy Gapon
on 03/11/2010 22:49 Jung-uk Kim said the following: On Wednesday 03 November 2010 04:25 pm, Jung-uk Kim wrote: Note I had to adjust resource length to prevent reading/writing beyond buffer size. It should work okay for acpi_pci_link_srs_from_links() case, I believe. It's a hack anyway. ;-)

RE: MacBookPro 5,1

2010-11-03 Thread Moore, Robert
: owner-freebsd-a...@freebsd.org [mailto:owner-freebsd- a...@freebsd.org] On Behalf Of Jung-uk Kim Sent: Wednesday, November 03, 2010 1:50 PM To: freebsd-acpi@FreeBSD.org Cc: Andriy Gapon; Lin, Ming M; Moore, Robert Subject: Re: MacBookPro 5,1 On Wednesday 03 November 2010 04:25 pm, Jung-uk Kim

Re: MacBookPro 5,1

2010-11-02 Thread Andriy Gapon
on 29/10/2010 08:51 Andriy Gapon said the following: I guess that a general problem here is that it is incorrect to merely use memcpy/bcopy to create a copy of a resource if the resource has ACPI_RESOURCE_SOURCE field in it. Hans, could you please test the following patch? diff --git

Re: MacBookPro 5,1

2010-11-02 Thread John Baldwin
On Tuesday, November 02, 2010 3:29:01 pm Jung-uk Kim wrote: On Tuesday 02 November 2010 11:29 am, Andriy Gapon wrote: on 29/10/2010 08:51 Andriy Gapon said the following: I guess that a general problem here is that it is incorrect to merely use memcpy/bcopy to create a copy of a resource

Re: MacBookPro 5,1

2010-11-02 Thread Jung-uk Kim
On Tuesday 02 November 2010 03:41 pm, John Baldwin wrote: On Tuesday, November 02, 2010 3:29:01 pm Jung-uk Kim wrote: On Tuesday 02 November 2010 11:29 am, Andriy Gapon wrote: on 29/10/2010 08:51 Andriy Gapon said the following: I guess that a general problem here is that it is incorrect

Re: MacBookPro 5,1

2010-11-02 Thread John Baldwin
On Tuesday, November 02, 2010 4:14:05 pm Jung-uk Kim wrote: On Tuesday 02 November 2010 03:41 pm, John Baldwin wrote: On Tuesday, November 02, 2010 3:29:01 pm Jung-uk Kim wrote: On Tuesday 02 November 2010 11:29 am, Andriy Gapon wrote: on 29/10/2010 08:51 Andriy Gapon said the following:

Re: MacBookPro 5,1

2010-11-02 Thread Jung-uk Kim
On Tuesday 02 November 2010 04:24 pm, John Baldwin wrote: On Tuesday, November 02, 2010 4:14:05 pm Jung-uk Kim wrote: On Tuesday 02 November 2010 03:41 pm, John Baldwin wrote: On Tuesday, November 02, 2010 3:29:01 pm Jung-uk Kim wrote: On Tuesday 02 November 2010 11:29 am, Andriy Gapon

Re: MacBookPro 5,1

2010-11-02 Thread John Baldwin
On Tuesday, November 02, 2010 4:50:18 pm Jung-uk Kim wrote: On Tuesday 02 November 2010 04:24 pm, John Baldwin wrote: On Tuesday, November 02, 2010 4:14:05 pm Jung-uk Kim wrote: On Tuesday 02 November 2010 03:41 pm, John Baldwin wrote: On Tuesday, November 02, 2010 3:29:01 pm Jung-uk Kim

Re: MacBookPro 5,1

2010-11-02 Thread Andriy Gapon
on 02/11/2010 22:50 Jung-uk Kim said the following: Yes, I understand. However, ACPICA is expecting the same size of buffer *including* the optional parts if I am reading the code right. Hmm, where is ACPICA doing that? I didn't see any connection between what *ACPICA* can return to OS in

Re: MacBookPro 5,1

2010-11-02 Thread Jung-uk Kim
On Tuesday 02 November 2010 05:50 pm, Andriy Gapon wrote: on 02/11/2010 22:50 Jung-uk Kim said the following: Yes, I understand. However, ACPICA is expecting the same size of buffer *including* the optional parts if I am reading the code right. Hmm, where is ACPICA doing that? If you

Re: MacBookPro 5,1

2010-10-29 Thread Lin Ming
On Fri, 2010-10-29 at 13:19 +0800, Andriy Gapon wrote: on 29/10/2010 03:34 Lin Ming said the following: Hi, guys Hans and I have found the root cause of this bug. I believe that there could be a root for a root :-) I will continue to check this bug next Monday. Hope we can find the

Re: MacBookPro 5,1

2010-10-28 Thread Lin Ming
On Fri, 2010-10-29 at 00:10 +0800, Hans Petter Selasky wrote: On Thursday 28 October 2010 17:24:32 Lin Ming wrote: On Thu, 2010-10-28 at 23:05 +0800, Lin Ming wrote: On Thu, 2010-10-28 at 22:55 +0800, Hans Petter Selasky wrote: On Thursday 28 October 2010 16:44:55 Lin Ming wrote: On

Re: MacBookPro 5,1

2010-10-28 Thread Andriy Gapon
on 29/10/2010 03:34 Lin Ming said the following: Hi, guys Hans and I have found the root cause of this bug. I believe that there could be a root for a root :-) The ResourceSource-StringLength set by up layer driver is wrong, see the patch below. Below patch fixes the bug and on Hans'

Re: MacBookPro 5,1

2010-10-28 Thread Andriy Gapon
on 29/10/2010 08:19 Andriy Gapon said the following: on 29/10/2010 03:34 Lin Ming said the following: Hi, guys Hans and I have found the root cause of this bug. I believe that there could be a root for a root :-) The ResourceSource-StringLength set by up layer driver is wrong, see the

Re: MacBookPro 5,1

2010-10-28 Thread Andriy Gapon
on 29/10/2010 08:23 Andriy Gapon said the following: on 29/10/2010 08:19 Andriy Gapon said the following: [snip] l_prs_template is populated in link_add_prs() function, which called to walk over resources returned by _PRS: http://fxr.watson.org/fxr/source/dev/acpica/acpi_pci_link.c#L499

Re: MacBookPro 5,1

2010-10-22 Thread Hans Petter Selasky
On Friday 22 October 2010 07:19:47 Lin Ming wrote: On Fri, 2010-10-22 at 10:39 +0800, Lin Ming wrote: On Fri, 2010-10-22 at 04:57 +0800, Hans Petter Selasky wrote: Here is the relevant output. First note, the buffer length is 512 and (uint8_t)512 = 0, so I modified the code to print out

Re: MacBookPro 5,1

2010-10-22 Thread Hans Petter Selasky
On Friday 22 October 2010 07:19:47 Lin Ming wrote: diff --git a/source/components/resources/rsxface.c b/source/components/resources/rsxface.c index 2a019d1..17b88e2 100644 --- a/source/components/resources/rsxface.c +++ b/source/components/resources/rsxface.c @@ -394,6 +394,7 @@

Re: MacBookPro 5,1

2010-10-21 Thread Lin Ming
On Thu, 2010-10-21 at 11:39 +0800, Lin Ming wrote: On Wed, 2010-10-20 at 16:06 +0800, Hans Petter Selasky wrote: On Wednesday 20 October 2010 08:36:31 Lin Ming wrote: On Wed, 2010-10-20 at 14:34 +0800, Hans Petter Selasky wrote: On Tuesday 19 October 2010 07:47:02 Lin Ming wrote: On

Re: MacBookPro 5,1

2010-10-21 Thread Hans Petter Selasky
Hi, I will get you the debug output from this patch in about 8 hours. --HPS On Thursday 21 October 2010 09:12:27 Lin Ming wrote: Hi, Could you apply below debug patch and attach the output? I'll try to reproduce this bug with the output. It will print something like below, Passed

Re: MacBookPro 5,1

2010-10-21 Thread Hans Petter Selasky
On Thursday 21 October 2010 09:12:27 Lin Ming wrote: On Thu, 2010-10-21 at 11:39 +0800, Lin Ming wrote: On Wed, 2010-10-20 at 16:06 +0800, Hans Petter Selasky wrote: On Wednesday 20 October 2010 08:36:31 Lin Ming wrote: On Wed, 2010-10-20 at 14:34 +0800, Hans Petter Selasky wrote:

Re: MacBookPro 5,1

2010-10-21 Thread Lin Ming
On Fri, 2010-10-22 at 04:57 +0800, Hans Petter Selasky wrote: On Thursday 21 October 2010 09:12:27 Lin Ming wrote: On Thu, 2010-10-21 at 11:39 +0800, Lin Ming wrote: On Wed, 2010-10-20 at 16:06 +0800, Hans Petter Selasky wrote: On Wednesday 20 October 2010 08:36:31 Lin Ming wrote:

Re: MacBookPro 5,1

2010-10-21 Thread Lin Ming
On Fri, 2010-10-22 at 10:39 +0800, Lin Ming wrote: On Fri, 2010-10-22 at 04:57 +0800, Hans Petter Selasky wrote: Here is the relevant output. First note, the buffer length is 512 and (uint8_t)512 = 0, so I modified the code to print out the 512 bytes. Passed in resource buffer

Re: MacBookPro 5,1

2010-10-20 Thread Hans Petter Selasky
On Tuesday 19 October 2010 07:47:02 Lin Ming wrote: On Tue, 2010-10-19 at 04:21 +0800, Hans Petter Selasky wrote: On Monday 18 October 2010 02:01:09 Moore, Robert wrote: Can you send us the acpidump for the machine? Also, tell us which control method is failing. Thanks Hi,

Re: MacBookPro 5,1

2010-10-20 Thread Lin Ming
On Wed, 2010-10-20 at 14:34 +0800, Hans Petter Selasky wrote: On Tuesday 19 October 2010 07:47:02 Lin Ming wrote: On Tue, 2010-10-19 at 04:21 +0800, Hans Petter Selasky wrote: On Monday 18 October 2010 02:01:09 Moore, Robert wrote: Can you send us the acpidump for the machine?

Re: MacBookPro 5,1

2010-10-20 Thread Andriy Gapon
on 20/10/2010 09:34 Hans Petter Selasky said the following: On Tuesday 19 October 2010 07:47:02 Lin Ming wrote: On Tue, 2010-10-19 at 04:21 +0800, Hans Petter Selasky wrote: On Monday 18 October 2010 02:01:09 Moore, Robert wrote: Can you send us the acpidump for the machine? Also, tell us

Re: MacBookPro 5,1

2010-10-20 Thread Hans Petter Selasky
On Wednesday 20 October 2010 08:55:09 Andriy Gapon wrote: on 20/10/2010 09:34 Hans Petter Selasky said the following: On Tuesday 19 October 2010 07:47:02 Lin Ming wrote: On Tue, 2010-10-19 at 04:21 +0800, Hans Petter Selasky wrote: On Monday 18 October 2010 02:01:09 Moore, Robert wrote:

Re: MacBookPro 5,1

2010-10-20 Thread Hans Petter Selasky
On Wednesday 20 October 2010 08:36:31 Lin Ming wrote: On Wed, 2010-10-20 at 14:34 +0800, Hans Petter Selasky wrote: On Tuesday 19 October 2010 07:47:02 Lin Ming wrote: On Tue, 2010-10-19 at 04:21 +0800, Hans Petter Selasky wrote: On Monday 18 October 2010 02:01:09 Moore, Robert wrote:

Re: MacBookPro 5,1

2010-10-20 Thread Andriy Gapon
on 20/10/2010 11:06 Hans Petter Selasky said the following: During the function call that overwrites it's buffer, there are no more debug prints than shown in the code, even with all debug prints on. Where should I add more debug prints? Maybe there are some useful messages right before the

Re: MacBookPro 5,1

2010-10-19 Thread Lin Ming
On Tue, 2010-10-19 at 04:21 +0800, Hans Petter Selasky wrote: On Monday 18 October 2010 02:01:09 Moore, Robert wrote: Can you send us the acpidump for the machine? Also, tell us which control method is failing. Thanks Hi, Please find attached dump of ACPI tables. It is the

Re: MacBookPro 5,1

2010-10-17 Thread Hans Petter Selasky
Hi, Some more debugging reveals that: The Resource type is 15, which is: ACPI_RSCONVERT_INFO AcpiRsConvertExtIrq[9] = And that it fails on: ACPI_RSC_SOURCEX That means it writes beyond the 11 bytes reserved for this element! During sub-routines of AcpiRsCreateAmlResources(). --HPS On

RE: MacBookPro 5,1

2010-10-17 Thread Moore, Robert
@freebsd.org Cc: linux-a...@vger.kernel.org Subject: Re: MacBookPro 5,1 Hi, CC'ing the Linux guys, hence I belive you are using the same ACPI code like in FreeBSD. It appears that when a string is present in the extended interrupt descriptor (6.4.3.6, ACPIspec30.pdf), then this is not handled

Re: MacBookPro 5,1

2010-10-13 Thread Andriy Gapon
on 13/10/2010 16:14 Hans Petter Selasky said the following: On Tuesday 12 October 2010 22:43:46 Andriy Gapon wrote: on 12/10/2010 15:25 Hans Petter Selasky said the following: On Tuesday 12 October 2010 13:15:26 Andriy Gapon wrote: on 12/10/2010 13:09 Hans Petter Selasky said the following:

Re: MacBookPro 5,1

2010-10-13 Thread Jung-uk Kim
On Tuesday 12 October 2010 06:09 am, Hans Petter Selasky wrote: Hi, My MacBookPro 5,1 does not boot using -current because memory inside the ACPI kernel module is used after free. The following patch temporily mitigates the problem: /usr/src/sys/dev/acpica/Osd/OsdMemory.c void

Re: MacBookPro 5,1

2010-10-12 Thread Andriy Gapon
on 12/10/2010 13:09 Hans Petter Selasky said the following: Hi, My MacBookPro 5,1 does not boot using -current because memory inside the ACPI kernel module is used after free. The following patch temporily mitigates the problem: /usr/src/sys/dev/acpica/Osd/OsdMemory.c void

Re: MacBookPro 5,1

2010-10-12 Thread Andriy Gapon
on 12/10/2010 15:25 Hans Petter Selasky said the following: On Tuesday 12 October 2010 13:15:26 Andriy Gapon wrote: on 12/10/2010 13:09 Hans Petter Selasky said the following: Hi, My MacBookPro 5,1 does not boot using -current because memory inside the ACPI kernel module is used after free.