By: , May 31, 2013 8:01 am
Room: Moderated Discussions
Klimax (danklima.delete@this.gmail.com) on May 31, 2013 7:15 am wrote:
> Simple example: Due to bug (like unchecked end of array) it will write past allocated range. (Or just
> randomly all over memory) And in process it will destroy whatever it can including kernel structure.
> For crazy reading about crazy programs I recommend http://ptgmedia.pearsoncmg.com/images/9780321440303/samplechapter/Chen_bonus_ch02.pdf
> Bonus chapter for book "The Old New Thing" by Raymond Chen.
>
> As for contiguous memory - arrays. (Enables simple and fast way to access
> any element while knowing only starting address and size of structure)
Thank you for your reply;
Now I understand how virtual addresses can help arrays through contiguous addresses. I suppose where the physical addresses is the DTLB's problem; but the ALU math is probably vastly simplified by having contiguous virtual memory to calculate like (array+2) instead of (YMM15*14/2^3), and there are probably other benefits that I'm not even seeing.
However, one question. Say an array has an error and just continues writing more and more and more elements to the array, filling memory. How would having contiguous virtual addresses prevent this from happening? I can see how it'd make it much easier to "clear" the memory of these errored entries, but is there a mechanism in place to detect if this error array is happening to stop it?
Thanks again!
> Simple example: Due to bug (like unchecked end of array) it will write past allocated range. (Or just
> randomly all over memory) And in process it will destroy whatever it can including kernel structure.
> For crazy reading about crazy programs I recommend http://ptgmedia.pearsoncmg.com/images/9780321440303/samplechapter/Chen_bonus_ch02.pdf
> Bonus chapter for book "The Old New Thing" by Raymond Chen.
>
> As for contiguous memory - arrays. (Enables simple and fast way to access
> any element while knowing only starting address and size of structure)
Thank you for your reply;
Now I understand how virtual addresses can help arrays through contiguous addresses. I suppose where the physical addresses is the DTLB's problem; but the ALU math is probably vastly simplified by having contiguous virtual memory to calculate like (array+2) instead of (YMM15*14/2^3), and there are probably other benefits that I'm not even seeing.
However, one question. Say an array has an error and just continues writing more and more and more elements to the array, filling memory. How would having contiguous virtual addresses prevent this from happening? I can see how it'd make it much easier to "clear" the memory of these errored entries, but is there a mechanism in place to detect if this error array is happening to stop it?
Thanks again!