On 29.10.2012 22:34, Jiří Zárevúcky wrote:
> some memory corruptions have been causing me trouble, so I implemented
> a rudimentary solution for detecting out-of-bounds accesses. With the
> commit linked bellow, every memory area created (including every
> fibril stack) gets an inaccessible page at both ends. While incredibly
> helpful (it pointed out my problem immediately, as well as a lingering
> bug in libclui), it is inefficient because the guard pages implemented
> this way consume memory.

Nice.

> Perhaps someone versed in kernel's memory management code would
> consider implementing something similar in kernel? It would likely
> even be more straightforward than what I've done.

We have already discussed a possible kernel solution to a part of the
problem:

http://lists.modry.cz/cgi-bin/private/helenos-devel/2012-August/008632.html

I.e. we need a flag that would disable memory reservations for selected
(stack) anonymous address space areas and, in the event of allocation
failure, kill the task instead of blocking.

Another flag could ask for an unmapped page or pages at the area's ends.
The anonymous backend could be made intelligent enough to resize the
area with this flag in mind.

Jakub

_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/cgi-bin/listinfo/helenos-devel

Reply via email to