Re: Strange Virtual Memory Mapping...!

From: Jakub Jelinek
Date: Fri Sep 30 2005 - 08:15:17 EST


On Fri, Sep 30, 2005 at 06:28:58PM +0530, Arijit Das wrote:
> I have RH3.0 installed in an AMD64 machine.
>
> In this system, when I look at the virtual address space mappings of a
> process (say a sleep process), I see quite a few strange memory region
> mappings which are neither readable, nor writable/executable and all of
> them are Private (i.e. unshared). Check this:
>
> 1024 ---p /lib64/tls/libc-2.3.2.so
> 1024 ---p /lib64/tls/libm-2.3.2.so
> 1024 ---p /lib64/tls/librtkaio-2.3.2.so
> 1024 ---p /lib64/tls/libpthread-0.60.so

Those are PROT_NONE mapping. As x86-64 has far bigger ELF page size
than the actual hardware page size commonly used ATM, there is usually
a gap between read-only/execute and read-write ELF segments.
It is undesirable to map anything in there (e.g. exception handling
would be very upset if you mapped a really small shared library in the
hole inside of another shared library) and PROT_NONE mapping prevents that.
If you strace some small process, you'll see that creating them is at most
as expensive as would be unmapping the regions.

Jakub
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/