MyNixOS website logo
Description

Portable Address Space Mapping.

Portable '/proc/self/maps' as a data frame. Determine which library or other region is mapped to a specific address of a process. -- R packages can contain native code, compiled to shared libraries at build or installation time. When loaded, each shared library occupies a portion of the address space of the main process. When only a machine instruction pointer is available (e.g. from a backtrace during error inspection or profiling), the address space map determines which library this instruction pointer corresponds to.

procmaps

Lifecycle: experimental R build status Codecov test coverage CRAN status

The goal of procmaps is to help determine which library or other region is mapped to a specific address of a process. It is the equivalent of /proc/self/maps as a data frame, and is designed to work on all major platforms.

Installation

You can install the released version of procmaps from CRAN with:

install.packages("procmaps")

Example

This is what /proc/self/maps looks like (on Linux) when this document is rendered:

cat /proc/self/maps
#> 56390592e000-563905936000 r-xp 00000000 fd:01 2883652                    /bin/cat
#> 563905b35000-563905b36000 r--p 00007000 fd:01 2883652                    /bin/cat
#> 563905b36000-563905b37000 rw-p 00008000 fd:01 2883652                    /bin/cat
#> 563906bb9000-563906bda000 rw-p 00000000 00:00 0                          [heap]
#> 7fb42c468000-7fb42c8c7000 r--p 00000000 fd:01 29370411                   /usr/lib/locale/locale-archive
#> 7fb42c8c7000-7fb42caae000 r-xp 00000000 fd:01 15731435                   /lib/x86_64-linux-gnu/libc-2.27.so
#> 7fb42caae000-7fb42ccae000 ---p 001e7000 fd:01 15731435                   /lib/x86_64-linux-gnu/libc-2.27.so
#> 7fb42ccae000-7fb42ccb2000 r--p 001e7000 fd:01 15731435                   /lib/x86_64-linux-gnu/libc-2.27.so
#> 7fb42ccb2000-7fb42ccb4000 rw-p 001eb000 fd:01 15731435                   /lib/x86_64-linux-gnu/libc-2.27.so
#> 7fb42ccb4000-7fb42ccb8000 rw-p 00000000 00:00 0 
#> 7fb42ccb8000-7fb42ccdf000 r-xp 00000000 fd:01 15731135                   /lib/x86_64-linux-gnu/ld-2.27.so
#> 7fb42ceb2000-7fb42ceb4000 rw-p 00000000 00:00 0 
#> 7fb42cebd000-7fb42cedf000 rw-p 00000000 00:00 0 
#> 7fb42cedf000-7fb42cee0000 r--p 00027000 fd:01 15731135                   /lib/x86_64-linux-gnu/ld-2.27.so
#> 7fb42cee0000-7fb42cee1000 rw-p 00028000 fd:01 15731135                   /lib/x86_64-linux-gnu/ld-2.27.so
#> 7fb42cee1000-7fb42cee2000 rw-p 00000000 00:00 0 
#> 7ffed6a9a000-7ffed6abc000 rw-p 00000000 00:00 0                          [stack]
#> 7ffed6b08000-7ffed6b0b000 r--p 00000000 00:00 0                          [vvar]
#> 7ffed6b0b000-7ffed6b0d000 r-xp 00000000 00:00 0                          [vdso]
#> ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

Other operating systems make this information available in other form. This package provides the equivalent as a data frame, regardless of operating system:

library(procmaps)
procmap_get()
#> Converting to tibble, mute this message with `as_tibble = TRUE`.
#> # A tibble: 378 x 6
#>    from         to          perms offset  inode  pathname                       
#>    <chr>        <chr>       <chr> <chr>   <chr>  <chr>                          
#>  1 000055cc2db… 000055cc2d… r-xp  000000… 29393… /usr/lib/R/bin/exec/R          
#>  2 000055cc2dd… 000055cc2d… r--p  000000… 29393… /usr/lib/R/bin/exec/R          
#>  3 000055cc2dd… 000055cc2d… rw-p  000010… 29393… /usr/lib/R/bin/exec/R          
#>  4 000055cc2e4… 000055cc33… rw-p  000000… 0      [heap]                         
#>  5 00007f9bac9… 00007f9bac… r-xp  000000… 28991… /home/kirill/git/R/r-prof/proc…
#>  6 00007f9bac9… 00007f9bac… ---p  000040… 28991… /home/kirill/git/R/r-prof/proc…
#>  7 00007f9bacb… 00007f9bac… r--p  000030… 28991… /home/kirill/git/R/r-prof/proc…
#>  8 00007f9bacb… 00007f9bac… rw-p  000040… 28991… /home/kirill/git/R/r-prof/proc…
#>  9 00007f9bacb… 00007f9bac… r-xp  000000… 28722… /home/kirill/R-dev/glue/libs/g…
#> 10 00007f9bacb… 00007f9bac… ---p  000020… 28722… /home/kirill/R-dev/glue/libs/g…
#> # … with 368 more rows

Code of Conduct

Please note that the procmaps project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Metadata

Version

0.0.5

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows