poll system call timeout

旧街凉风 提交于 2019-12-09 14:38:26

问题


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


回答1:


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



回答2:


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.



来源:https://stackoverflow.com/questions/13018981/poll-system-call-timeout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!