poll system call timeout
Asked Answered
S

2

19

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

Shriek answered 22/10, 2012 at 20:6 Comment(4)
Depends. What are these six fds? Did you find matching calls to open() in the trace log?Apocynaceous
I don't know. WHat does that mean?Shriek
Can you explain the steps in a reply? What do you mean by matching?Shriek
Assuming these file descriptors are actually files (as opposed to sockets or pipes), there should be calls to the open() syscall in the output of strace. You would have to look for the ones that returned 5, 6, etc. in order to determine which files were opened.Apocynaceous
O
31

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
Overburdensome answered 22/10, 2012 at 20:59 Comment(3)
Here it happens when I try to # su - vuXXXX which has worked before. Can it be that su tries to lookup a host name or so?Ischium
I stopped dbus and tried it again. And it went very fast. So the bottleneck/culprit is dbus in my case.Ischium
I found the actual culprit: elogind Session Management caused the slowdown.Ischium
E
0

ls -l /proc//fd/ -> You will get the corresponding node Id. ss -p | grep -> you will get the socket file path the fd belongs to.

Expenditure answered 17/11, 2018 at 15:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.