poll system call timeout

mahmood picture mahmood · Oct 22, 2012 · Viewed 24.7k times · Source

Attaching strace shows a lot of these messages:

poll([{fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}, {fd=9, events=POLLIN}, {fd=10, events=POLLIN}], 6, 0) = 0 (Timeout)

poll([{fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}, {fd=9, events=POLLIN}, {fd=10, events=POLLIN}], 6, 0) = 0 (Timeout)

poll([{fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}, {fd=9, events=POLLIN}, {fd=10, events=POLLIN}], 6, 0) = 0 (Timeout)

poll([{fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}, {fd=9, events=POLLIN}, {fd=10, events=POLLIN}], 6, 0) = 0 (Timeout)

How can I find what file the program is trying to access that causes poll system call to timeout?

strace generates a lot of messages which make it hard to debug

Answer

Maxim Egorushkin picture Maxim Egorushkin · Oct 22, 2012

How can I find what file the program is trying to access that causes poll system call to timeout?

Invoke:

lsof -p <pid>

And see what the file descriptors in question refer to.

You can also take a look into proc filesystem on Linux:

ls -l /proc/<pid>/fd