Re: Kext symbolizing & missing kernel slide
Re: Kext symbolizing & missing kernel slide
- Subject: Re: Kext symbolizing & missing kernel slide
- From: Andrew Keller <email@hidden>
- Date: Thu, 25 Aug 2016 22:21:34 -0400
Am 25.08.2016 um 6:22 nachm. schrieb Brian Bechtel <email@hidden>:
> Apple implemented kernel address slide randomization in 10.8. Assume a slide of zero for 10.7 and earlier.
Wow! Didn’t know that.
With that, I was able to pretty confidently symbolize the backtrace, and it points to one of the lines of assembly before the first line of my code in a function. Perhaps that’s the machine code that pushes the function's local variables onto the stack? If all stack memory for a function is allocated immediately (question about that below), then it would not be surprising that the stack overflow happens when the function loads all of its local variables onto the stack, before the first line of my code.
> Double fault panics usually indicate you are using too much of the very limited 16K kernel stack space. Look for allocation of large arrays on the stack.
Is all memory required for all local variables in a given function allocated on the stack immediately upon invoking the function, or are local variables dynamically created and destroyed on the stack as the function drags on and variables transition in and out of scope?
If you say it’s the former, then I have a suspect — A macro that allocates a 4KB array on the stack every time it’s used. In the entire call stack leading up to the panic, there are 3 usages of that macro. All it would take is 4KB of other stuff on the stack for something to go _boom_.
Fortunately, that macro represents a goldmine of opportunities for improvement. It’s straight-forward, relatively isolated, and easy to change without risking breaking other things.
Thanks,
- Andrew Keller
_______________________________________________
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