Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Oct 2010 19:08:09 +0300
From:      Andriy Gapon <avg@icyb.net.ua>
To:        Hans Petter Selasky <hselasky@c2i.net>
Cc:        freebsd-acpi@freebsd.org
Subject:   Re: MacBookPro 5,1
Message-ID:  <4CB5D969.5030108@icyb.net.ua>
In-Reply-To: <201010131514.57188.hselasky@c2i.net>
References:  <201010121209.06397.hselasky@c2i.net>	<201010121425.07279.hselasky@c2i.net>	<4CB4C882.6050006@icyb.net.ua> <201010131514.57188.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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:
>>>>> 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?
>>>>
>>>> I think that the best way is to get a backtrace at least or better a
>>>> crashdump.
>>>
>>> The crashdump is not helpful. It crashes at init time, while the actual
>>> free happens very early during boot.
>>
>> Still a backtrace would be useful, I think.

So no backtrace yet? :-)

>> Or track all calls to AcpiOsFree, e.g. using DTrace or stack(9) or etc.
> 
> Do you have any hints how a shall configure DTrace to trace AcpiOsFree() ?

You set up DTrace using general procedure:
http://wiki.freebsd.org/DTrace

The you can write a little DTrace script to trace calls to AcpiOsFree (and
perhaps/probably AcpiOsAllocate) using fbt provider:
http://wikis.sun.com/display/DTrace/fbt+Provider

Sorry, EBUSY to write a complete script right now.
You might find DTrace function stack() and aggregations useful.

Things are bit trickier if the crash happens before you have a chance to do
anything in userland.
-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4CB5D969.5030108>