开发者

Memory Regions displayed in SMAPS output with no permissions

开发者 https://www.devze.com 2022-12-29 12:02 出处:网络
If I see the output of cat /proc//smaps, I find that there are some memory regions with which no read/write/execute permissions have been associated. Also these region are mapped to inode number 0.

If I see the output of cat /proc//smaps, I find that there are some memory regions with which no read/write/execute permissions have been associated. Also these region are mapped to inode number 0.

I wanted to know how does a region end up in such a state? Is it some sort of memory leak?

Can these regions开发者_运维百科 be ever used again by the process?


They're not leaks. They're created by calling mmap() with the MAP_ANONYMOUS and PROT_NONE flags. The process can still use that virtual address space: it could unmap the regions with munmap(), or alter the protections with mprotect().

Such regions are typically used to set up guard pages, which are intended to trigger a signal when a growing data structure grows beyond its current bound.

0

精彩评论

暂无评论...
验证码 换一张
取 消