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
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.
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With