lsof icon indicating copy to clipboard operation
lsof copied to clipboard

[BUG] list memory mapped files returns with 'stat: No such file or directory'

Open Hunter1016 opened this issue 3 years ago • 2 comments

Describe the bug list memory mapped files in different mount namespace return with 'stat: No such file or directory'.

To Reproduce Steps to reproduce the behavior:

  1. Run 'lsof -p ', this pid in a different mount namespace from lsof itself, for example, a container process.
  2. See error

Expected behavior Should not print 'stat: No such file or directory'.

Program output COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME bash 2307034 root cwd DIR 0,104 4096 2233949 /root bash 2307034 root rtd DIR 0,104 4096 2361890 / bash 2307034 root txt REG 0,104 964536 2234000 /usr/bin/bash bash 2307034 root mem REG 254,1 2234000 /usr/bin/bash (path inode=263609) bash 2307034 root mem REG 254,1 2236028 /usr/lib64/libnss_files-2.17.so (stat: No such file or directory) bash 2307034 root mem REG 254,1 2235885 /usr/lib64/libc-2.17.so (stat: No such file or directory) bash 2307034 root mem REG 254,1 2235914 /usr/lib64/libdl-2.17.so (stat: No such file or directory) bash 2307034 root mem REG 254,1 2236135 /usr/lib64/libtinfo.so.5.9 (stat: No such file or directory) bash 2307034 root mem REG 254,1 2235861 /usr/lib64/ld-2.17.so (stat: No such file or directory) bash 2307034 root 0u CHR 136,0 0t0 3 /dev/pts/0 bash 2307034 root 1u CHR 136,0 0t0 3 /dev/pts/0 bash 2307034 root 2u CHR 136,0 0t0 3 /dev/pts/0 bash 2307034 root 255u CHR 136,0 0t0 3 /dev/pts/0

Environment (please complete the following information):

  • Kernel: 4.19
  • OS: Debian
  • lsof Version: 4.91

Hunter1016 avatar Jul 20 '22 08:07 Hunter1016

#239

Hunter1016 avatar Jul 20 '22 08:07 Hunter1016

I think we have similar problem with regard to other namespaces, e.g. userns, netns.

jiegec avatar Jul 20 '22 09:07 jiegec