Linux / proc / / map的输出详细

时间:2023-01-11 02:54:06

In the following, you can see the 'cat proc/pid/maps' output of my running wu-ftpd:

在下面,您可以看到我运行的wu-ftpd的'cat proc / pid / maps'输出:

00400000-00427000 r-xp 00000000 ca:01 64883                              /usr/sbin/wu-ftpd
00626000-00627000 r--p 00026000 ca:01 64883                              /usr/sbin/wu-ftpd
00627000-00629000 rw-p 00027000 ca:01 64883                              /usr/sbin/wu-ftpd
00629000-00644000 rw-p 00000000 00:00 0
0245f000-02480000 rw-p 00000000 00:00 0                                  [heap]
7f1db9d70000-7f1db9d7c000 r-xp 00000000 ca:01 483644                     /lib/x86_64-linux-gnu/libnss_files-2.15.so
7f1db9d7c000-7f1db9f7b000 ---p 0000c000 ca:01 483644                     /lib/x86_64-linux-gnu/libnss_files-2.15.so
7f1db9f7b000-7f1db9f7c000 r--p 0000b000 ca:01 483644                     /lib/x86_64-linux-gnu/libnss_files-2.15.so
7f1db9f7c000-7f1db9f7d000 rw-p 0000c000 ca:01 483644                     /lib/x86_64-linux-gnu/libnss_files-2.15.so
7f1db9f7d000-7f1db9f7f000 r-xp 00000000 ca:01 483655                     /lib/x86_64-linux-gnu/libdl-2.15.so
7f1db9f7f000-7f1dba17f000 ---p 00002000 ca:01 483655                     /lib/x86_64-linux-gnu/libdl-2.15.so
7f1dba17f000-7f1dba180000 r--p 00002000 ca:01 483655                     /lib/x86_64-linux-gnu/libdl-2.15.so
7f1dba180000-7f1dba181000 rw-p 00003000 ca:01 483655                     /lib/x86_64-linux-gnu/libdl-2.15.so
7f1dba181000-7f1dba336000 r-xp 00000000 ca:01 483640                     /lib/x86_64-linux-gnu/libc-2.15.so
7f1dba336000-7f1dba536000 ---p 001b5000 ca:01 483640                     /lib/x86_64-linux-gnu/libc-2.15.so
7f1dba536000-7f1dba53a000 r--p 001b5000 ca:01 483640                     /lib/x86_64-linux-gnu/libc-2.15.so
7f1dba53a000-7f1dba53c000 rw-p 001b9000 ca:01 483640                     /lib/x86_64-linux-gnu/libc-2.15.so
7f1dba53c000-7f1dba541000 rw-p 00000000 00:00 0
7f1dba541000-7f1dba54d000 r-xp 00000000 ca:01 482456                     /lib/x86_64-linux-gnu/libpam.so.0.83.0
7f1dba54d000-7f1dba74d000 ---p 0000c000 ca:01 482456                     /lib/x86_64-linux-gnu/libpam.so.0.83.0
7f1dba74d000-7f1dba74e000 r--p 0000c000 ca:01 482456                     /lib/x86_64-linux-gnu/libpam.so.0.83.0
7f1dba74e000-7f1dba74f000 rw-p 0000d000 ca:01 482456                     /lib/x86_64-linux-gnu/libpam.so.0.83.0
7f1dba74f000-7f1dba758000 r-xp 00000000 ca:01 483641                     /lib/x86_64-linux-gnu/libcrypt-2.15.so
7f1dba758000-7f1dba958000 ---p 00009000 ca:01 483641                     /lib/x86_64-linux-gnu/libcrypt-2.15.so
7f1dba958000-7f1dba959000 r--p 00009000 ca:01 483641                     /lib/x86_64-linux-gnu/libcrypt-2.15.so
7f1dba959000-7f1dba95a000 rw-p 0000a000 ca:01 483641                     /lib/x86_64-linux-gnu/libcrypt-2.15.so
7f1dba95a000-7f1dba988000 rw-p 00000000 00:00 0
7f1dba988000-7f1dba9aa000 r-xp 00000000 ca:01 483652                     /lib/x86_64-linux-gnu/ld-2.15.so
7f1dbab9e000-7f1dbaba2000 rw-p 00000000 00:00 0
7f1dbaba8000-7f1dbabaa000 rw-p 00000000 00:00 0
7f1dbabaa000-7f1dbabab000 r--p 00022000 ca:01 483652                     /lib/x86_64-linux-gnu/ld-2.15.so
7f1dbabab000-7f1dbabad000 rw-p 00023000 ca:01 483652                     /lib/x86_64-linux-gnu/ld-2.15.so
7fff20555000-7fff20576000 rw-p 00000000 00:00 0                          [stack]
7fff205fe000-7fff20600000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

There are some memory ranges, for example:

有一些内存范围,例如:

  • 00629000-00644000 (line 4) or
  • 00629000-00644000(第4行)或

  • 7f1dba95a000-7f1dba988000 (line 21 right after /lib/x86_64-linux-gnu/libcrypt-2.15.so)
  • 7f1dba95a000-7f1dba988000(/lib/x86_64-linux-gnu/libcrypt-2.15.so之后的第21行)

which do not have a description (like heap, stack or the shared library). What are these regions? For what are they used?

没有描述(如堆,堆栈或共享库)。这些地区是什么?他们用的是什么?

Thank you!

1 个解决方案

#1


1  

Those are anonymous mappings, created by mmap() with the MAP_ANONYMOUS flag. In this case they probably correspond to the BSS segments of the mapped binaries (eg the first one is the BSS segment of /usr/sbin/wu-ftpd).

这些是匿名映射,由mmap()和MAP_ANONYMOUS标志创建。在这种情况下,它们可能对应于映射二进制文件的BSS段(例如,第一个是/ usr / sbin / wu-ftpd的BSS段)。

The BSS is where statically allocated objects initialised to zero are mapped - it's a segment that doesn't take up space in the binary itself, because there's no point in storing a heap of zeroes.

BSS是初始化为零的静态分配对象的映射 - 它是一个不占用二进制本身空间的段,因为存储一堆零没有意义。

It's also possible to have anonymous mappings resulting from large allocations made with malloc() - small allocations are satisfied from the heap, but large allocations often get their own anonymous mapping.

使用malloc()进行大量分配也可能产生匿名映射 - 从堆中满足小分配,但是大分配通常会得到自己的匿名映射。

#1


1  

Those are anonymous mappings, created by mmap() with the MAP_ANONYMOUS flag. In this case they probably correspond to the BSS segments of the mapped binaries (eg the first one is the BSS segment of /usr/sbin/wu-ftpd).

这些是匿名映射,由mmap()和MAP_ANONYMOUS标志创建。在这种情况下,它们可能对应于映射二进制文件的BSS段(例如,第一个是/ usr / sbin / wu-ftpd的BSS段)。

The BSS is where statically allocated objects initialised to zero are mapped - it's a segment that doesn't take up space in the binary itself, because there's no point in storing a heap of zeroes.

BSS是初始化为零的静态分配对象的映射 - 它是一个不占用二进制本身空间的段,因为存储一堆零没有意义。

It's also possible to have anonymous mappings resulting from large allocations made with malloc() - small allocations are satisfied from the heap, but large allocations often get their own anonymous mapping.

使用malloc()进行大量分配也可能产生匿名映射 - 从堆中满足小分配,但是大分配通常会得到自己的匿名映射。