MacBookPro 5,1

Jung-uk Kim jkim at FreeBSD.org
Wed Oct 13 23:58:10 UTC 2010


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
> AcpiOsFree(void *Memory)
> {
> + if (cold == 0)
>     free(Memory, M_ACPICA);
> }
>
> Is there any way to debug this from user-land?

acpidb(8).  However, it is quite broken ATM. :-(

Alternatively, you may use acpiexec from ACPICA:

fetch http://www.acpica.org/download/acpica-unix-20101013.tar.gz
tar xpf acpica-unix-20101013.tar.gz
cd acpica-unix-20101013/tools/acpiexec
gmake
./acpiexec

Actually you need to extract ACPI tables from your BIOS (or UEFI in
your case) to use with acpiexec.  acpidump(8) gives you what you want
BUT you cannot use it with acpiexec directly.  You need to dump/extract
tables using Linux pmtools:

fetch http://ftp.kernel.org/pub/linux/kernel/people/lenb/acpi/utils/pmtools-20100825.tar.bz2
fetch http://people.freebsd.org/~jkim/pmtools-20100825.diff
tar xpf pmtools-20100825.tar.bz2
cd pmtools
patch < ../pmtools-20100825.diff
gmake
sudo acpidump/acpidump -o ACPI.dat
acpixtract/acpixtract -a ACPI.dat

Note the pmtools patch is really a hack but it should work. ;-)

Good luck,

Jung-uk Kim

* PS: If anyone has enough free time, please fix acpidb.


More information about the freebsd-acpi mailing list