2

I'm currently debugging a system which has a resource leak. It seems that we have too many pipes open. When I list my /proc/PROC_ID/fd I see the following list of pipes:

l-wx------ 1 root root 64 Jun 30 12:32 100 -> pipe:[39199]
lr-x------ 1 root root 64 Jun 30 12:32 99 -> pipe:[39199]

this suggests an open pipe, with both RW ends.

When I use lsof, I see that there are a lot of results with this pipe ID

COMMAND    PID  TID           USER   FD      TYPE             DEVICE  SIZE/OFF       NODE NAME
myapp      7209                root   99r     FIFO                0,8       0t0      39199 pipe
myapp      7209                root  100w     FIFO                0,8       0t0      39199 pipe
myapp      7209 7210           root   99r     FIFO                0,8       0t0      39199 pipe
myapp      7209 7210           root  100w     FIFO                0,8       0t0      39199 pipe
myapp      7209 7211           root   99r     FIFO                0,8       0t0      39199 pipe
myapp      7209 7211           root  100w     FIFO                0,8       0t0      39199 pipe
myapp      7209 7212           root   99r     FIFO                0,8       0t0      39199 pipe
...

so there are several threads using the pipes. Now, I need some help interpreting this info.

  1. What is the ID next to the pipe (in ls)? Can I get it from the call to pipe() somehow?
  2. Why does the type in lsof is FIFO and not PIPE? I checked the manpage and there is a separate type for it. Did I get it wrong? I'm on RHEL 7.2

UPDATE to be more clear on the second question - judging by the pipe:[<number>] output of the ls, the object looks like an anonymous pipe. However, the lsof type is FIFO and not PIPE. I don't understand how these refer to the same object.

cheers

1

1 Answer 1

1

For question 1 :

According to Debugging IPC with Shell Commands (see §8.7.1), 39199 in pipe:[39199] is an inode number. Unlike "regular" files stored on physical devices, such inode numbers don't relate to actual files as they belong to virtual filesystems (see §8.8).

As far as I understand it, the point of these inodes is not "what the inode xxxx refers to", but rather that processes sharing inodes are actually communicating with each other. Such processes may be output by :

lsof | grep <inodeNumber>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .