Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

poll system call timeout

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

like image 497
mahmood Avatar asked Oct 22 '12 20:10

mahmood


People also ask

What is poll timeout?

The polling timeout specifies the amount of time the system waits for a response to a poll. The default is 700 milliseconds. Whenever you increase the polling timeout, pay attention to the effect on the cumulative value for the polling timeout. On each successive retry, the polling timeout is doubled.

How does a poll system call work?

The poll() feature allows programs to multiplex input and output through a series of file descriptors. In other words, the poll() system call is analogous to select() system call in working as it holds its fire for one of several file descriptors by becoming available for I/O.

Is poll a system call?

The poll() system call was introduced in Linux 2.1. 23. On older kernels that lack this system call, the glibc poll() wrapper function provides emulation using select(2). The ppoll() system call was added to Linux in kernel 2.6.

How is poll () used?

The poll() function is used to enable an application to multiplex I/O over a set of descriptors. For each member of the array pointed to by fds, poll() will examine the given descriptor for the event(s) specified. nfds is the number of pollfd structures in the fds array.


1 Answers

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
like image 61
Maxim Egorushkin Avatar answered Oct 01 '22 22:10

Maxim Egorushkin