| 1 |
.\" Copyright 1994-1995, Daniel Quinlan <[email protected]> |
| 2 |
.\" Copyright 2002-2017, Michael Kerrisk <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: GPL-3.0-or-later |
| 6 |
.\" |
| 7 |
.TH proc_pid_maps 5 2026-02-08 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
/proc/pid/maps \- mapped memory regions |
| 10 |
.SH DESCRIPTION |
| 11 |
.TP |
| 12 |
.IR /proc/ pid /maps |
| 13 |
A file containing the currently mapped memory regions and their access |
| 14 |
permissions. |
| 15 |
See |
| 16 |
.BR mmap (2) |
| 17 |
for some further information about memory mappings. |
| 18 |
.IP |
| 19 |
Permission to access this file is governed by a ptrace access mode |
| 20 |
.B PTRACE_MODE_READ_FSCREDS |
| 21 |
check; |
| 22 |
see |
| 23 |
.BR ptrace (2). |
| 24 |
.IP |
| 25 |
The format of the file is: |
| 26 |
.IP |
| 27 |
.in +4n |
| 28 |
.EX |
| 29 |
.I "address perms offset dev inode pathname" |
| 30 |
00400000\-00452000 r\-xp 00000000 08:02 173521 /usr/bin/dbus\-daemon |
| 31 |
00651000\-00652000 r\-\-p 00051000 08:02 173521 /usr/bin/dbus\-daemon |
| 32 |
00652000\-00655000 rw\-p 00052000 08:02 173521 /usr/bin/dbus\-daemon |
| 33 |
00e03000\-00e24000 rw\-p 00000000 00:00 0 [heap] |
| 34 |
00e24000\-011f7000 rw\-p 00000000 00:00 0 [heap] |
| 35 |
\&... |
| 36 |
35b1800000\-35b1820000 r\-xp 00000000 08:02 135522 /usr/lib64/ld\-2.15.so |
| 37 |
35b1a1f000\-35b1a20000 r\-\-p 0001f000 08:02 135522 /usr/lib64/ld\-2.15.so |
| 38 |
35b1a20000\-35b1a21000 rw\-p 00020000 08:02 135522 /usr/lib64/ld\-2.15.so |
| 39 |
35b1a21000\-35b1a22000 rw\-p 00000000 00:00 0 |
| 40 |
35b1c00000\-35b1dac000 r\-xp 00000000 08:02 135870 /usr/lib64/libc\-2.15.so |
| 41 |
35b1dac000\-35b1fac000 \-\-\-p 001ac000 08:02 135870 /usr/lib64/libc\-2.15.so |
| 42 |
35b1fac000\-35b1fb0000 r\-\-p 001ac000 08:02 135870 /usr/lib64/libc\-2.15.so |
| 43 |
35b1fb0000\-35b1fb2000 rw\-p 001b0000 08:02 135870 /usr/lib64/libc\-2.15.so |
| 44 |
\&... |
| 45 |
f2c6ff8c000\-7f2c7078c000 rw\-p 00000000 00:00 0 [stack:986] |
| 46 |
\&... |
| 47 |
7fffb2c0d000\-7fffb2c2e000 rw\-p 00000000 00:00 0 [stack] |
| 48 |
7fffb2d48000\-7fffb2d49000 r\-xp 00000000 00:00 0 [vdso] |
| 49 |
.EE |
| 50 |
.in |
| 51 |
.IP |
| 52 |
The |
| 53 |
.I address |
| 54 |
field is the address space in the process that the mapping occupies. |
| 55 |
The |
| 56 |
.I perms |
| 57 |
field is a set of permissions: |
| 58 |
.IP |
| 59 |
.in +4n |
| 60 |
.EX |
| 61 |
r = read |
| 62 |
w = write |
| 63 |
x = execute |
| 64 |
s = shared |
| 65 |
p = private (copy on write) |
| 66 |
.EE |
| 67 |
.in |
| 68 |
.IP |
| 69 |
The |
| 70 |
.I offset |
| 71 |
field is the offset into the file/whatever; |
| 72 |
.I dev |
| 73 |
is the device |
| 74 |
(major:minor); |
| 75 |
.I inode |
| 76 |
is the inode on that device. |
| 77 |
0 indicates that no inode is associated with the memory region, |
| 78 |
as would be the case with BSS (uninitialized data). |
| 79 |
.IP |
| 80 |
The |
| 81 |
.I pathname |
| 82 |
field will usually be the file that is backing the mapping. |
| 83 |
For ELF files, |
| 84 |
you can easily coordinate with the |
| 85 |
.I offset |
| 86 |
field by looking at the |
| 87 |
Offset field in the ELF program headers |
| 88 |
.RI ( "readelf\ \-l" ). |
| 89 |
.IP |
| 90 |
There are additional helpful pseudo-paths: |
| 91 |
.RS |
| 92 |
.TP |
| 93 |
.I [stack] |
| 94 |
The initial process's (also known as the main thread's) stack. |
| 95 |
.TP |
| 96 |
.IR [stack: tid ] " (from Linux 3.4 to Linux 4.4)" |
| 97 |
.\" commit b76437579d1344b612cf1851ae610c636cec7db0 (added) |
| 98 |
.\" commit 65376df582174ffcec9e6471bf5b0dd79ba05e4a (removed) |
| 99 |
A thread's stack (where the |
| 100 |
.I tid |
| 101 |
is a thread ID). |
| 102 |
It corresponds to the |
| 103 |
.IR /proc/ pid /task/ tid / |
| 104 |
path. |
| 105 |
This field was removed in Linux 4.5, since providing this information |
| 106 |
for a process with large numbers of threads is expensive. |
| 107 |
.TP |
| 108 |
.I [vdso] |
| 109 |
The virtual dynamically linked shared object. |
| 110 |
See |
| 111 |
.BR vdso (7). |
| 112 |
.TP |
| 113 |
.I [heap] |
| 114 |
The process's heap. |
| 115 |
.TP |
| 116 |
.IR [anon: name ] " (since Linux 5.17)" |
| 117 |
.\" Commit 9a10064f5625d5572c3626c1516e0bebc6c9fe9b |
| 118 |
A named private anonymous mapping. |
| 119 |
Set with |
| 120 |
.BR prctl (2) |
| 121 |
.BR PR_SET_VMA_ANON_NAME . |
| 122 |
.TP |
| 123 |
.IR [anon_shmem: name ] " (since Linux 6.2)" |
| 124 |
.\" Commit d09e8ca6cb93bb4b97517a18fbbf7eccb0e9ff43 |
| 125 |
A named shared anonymous mapping. |
| 126 |
Set with |
| 127 |
.BR prctl (2) |
| 128 |
.BR PR_SET_VMA_ANON_NAME . |
| 129 |
.in |
| 130 |
.RE |
| 131 |
.IP |
| 132 |
If the |
| 133 |
.I pathname |
| 134 |
field is blank, |
| 135 |
this is an anonymous mapping as obtained via |
| 136 |
.BR mmap (2). |
| 137 |
There is no easy way to coordinate this back to a process's source, |
| 138 |
short of running it through |
| 139 |
.BR gdb (1), |
| 140 |
.BR strace (1), |
| 141 |
or similar. |
| 142 |
.IP |
| 143 |
.I pathname |
| 144 |
is shown unescaped except for newline characters, which are replaced |
| 145 |
with an octal escape sequence. |
| 146 |
As a result, it is not possible to determine whether the original |
| 147 |
pathname contained a newline character or the literal |
| 148 |
.I \[rs]012 |
| 149 |
character sequence. |
| 150 |
.IP |
| 151 |
If the mapping is file-backed and the file has been deleted, the string |
| 152 |
" (deleted)" is appended to the pathname. |
| 153 |
Note that this is ambiguous too. |
| 154 |
.IP |
| 155 |
Under Linux 2.0, there is no field giving pathname. |
| 156 |
.SH SEE ALSO |
| 157 |
.BR proc (5) |