3

I'm trying to debug a file descriptor leak in a program. I'm looking at Activity Monitor's "Open Files and Ports" window in hopes of gleaning some information.

I see several types of entries. Here's a sample:

cwd
/
txt
/Applications/Utilities/Activity Monitor.app/Contents/MacOS/Activity Monitor
0
/dev/null
1
/dev/null
2
/dev/null
3
4
5
6
7
->0x1c8e9b47ad822e5b

I believe that I understand several things about this format:

  • In general, a first line tells the file descriptor and the second line shows where it points:
    • cwd / means that the current directory of the app is /
    • txt /Applications/.../Activity Monitor means that "Activity Monitor" is mapped into memory without having an open file descriptor
    • 0 /dev/null means that file descriptor 0 is associated to /dev/null
    • 7 ->0x1c8e9b47ad822e5b means that file descriptor 7 is associated to a file-like object that doesn't have a persistent name (?)

But what about file descriptors 3 through 6? What are they associated to?

1

Activity Monitor shows the result of lsof -Fn -p [pid], stripping the first character from each line. The meaning of a missing file entry remains unclear, but regular possibilities are shown in the lsof man page (man lsof in the terminal) under the NAME section.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.