【发布时间】:2012-10-12 17:00:11
【问题描述】:
附加strace 会显示很多这样的消息:
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)
如何找到程序试图访问导致poll 系统调用超时的文件?
strace 生成大量消息,难以调试
【问题讨论】:
-
视情况而定。这六个 fd 是什么?您是否在跟踪日志中找到了对
open()的匹配调用? -
我不知道。这是什么意思?
-
你能解释一下回复中的步骤吗?匹配是什么意思?
-
假设这些文件描述符实际上是文件(而不是套接字或管道),应该在
strace的输出中调用open()系统调用。您必须查找返回5、6等的文件才能确定打开了哪些文件。
标签: linux system-calls strace