Re: Tips for resolving hpfBadPmap?
Re: Tips for resolving hpfBadPmap?
- Subject: Re: Tips for resolving hpfBadPmap?
- From: Terry Lambert <email@hidden>
- Date: Thu, 16 Mar 2006 16:49:02 -0800
On Mar 16, 2006, at 10:39 AM, david tay wrote:
Hi,
I'm getting random kernel panics when my kext is used with the
following message -
Program received signal SIGTRAP, Trace/breakpoint trap.
0x0009ff50 in hpfBadPmap ()
It seems that the physical mapping is somehow incorrect. Any ideas
on what could be causing this?
My memory allocations are done either
myMemory = IOMalloc(),
buffer = IOBufferMemoryDescriptor:withOptions(kIODirectionInOut,
some_computed_size, page_size);
bufferPtr = buffer->getBytesNoCopy();
buffer2 = OSTypeAlloc(),
buffer2->initSubRange();
buffer2->prepare();
Check that the pointers returned to your allocation requests have not
been denied, before you dereference the pointers.
Turn on the debugging flags indicated in the kernel debugging
documentation that comes with the kernel debug kits, and also on
developer.apple.com, so that you can provide better information other
than "it panic's" - e.g. Is it a DAR panic, and if so, at what address
does the panic happen, and if it's a low address, is this indicative
of you dereferencing a NULL pointer, etc., etc..
If none of this is happening because of a direct coding error, then
that panic is somewhat indicative of your kext going off into the
weeds and corrupting pmap data structures in memory.
If your kext is a device driver for a device that uses DMA, make sure
that the DMA target addresses are not required to be in low memory
because the device in question is unable to address as much memory as
you have in the system, either as a result of a devie limitation or a
bus limitation - if you pass a DMA request an out of range memory
address, it will (obviously) wrap to that address modulo the number of
bits it's capable of addressing, and then the transfer will take place
to memory other than the memory you were intending it to go to.
In general, it's probably time for you to start to become comfortable
with two machine kernel debugging. More information is available from
developer.apple.com.
-- Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden