我想通过 pywebkitgtk 捕获网页。我在那台机器上安装了 X org 服务器,启动了 X 服务器,但出现了一些异常,但 X 服务器正在运行。问题是我无法从 X unix 套接字读取任何数据,它是 PF_FILE 类型,path=@"/tmp/.X11-unix/X0",recvfrom 抛出 EAGAIN(资源暂时不可用)错误,轮询该套接字在没有任何数据的情况下不断超时,下面是跟踪日志,我们可以在其中找到使用 fd 5 成功创建的 unix 套接字,连接 unix 套接字,到目前为止成功,但未能从该 unix 套接字读取任何内容。
developer@kernel: /data/play/null> strace python ../pywebkitgtk-1.1.8/demos/browser.py
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC, 0) = 5
connect(5, {sa_family=AF_FILE, path=@"/tmp/.X11-unix/X0"}, 20) = 0
getpeername(5, {sa_family=AF_FILE, path=@"/tmp/.X11-unix/X0"}, [20]) = 0
...........................
recvfrom(5, "\1\3\304\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 4096, 0, NULL, NULL) = 32
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=5, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=5, revents=POLLOUT}])
writev(5, [{"\220\10\7\0\0\1G\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 \1", 28}, {NULL, 0}, {"", 0}], 3) = 28
poll([{fd=5, events=POLLIN}], 1, -1) = 1 ([{fd=5, revents=POLLIN}])
recvfrom(5, "\1\3\305\1X\4\0\0\0\0\10\377G\0\0\31\31\0104\1\370\0\0\0\0\0\0\0\0\0\0\10"..., 4096, 0, NULL, NULL) = 4096
recvfrom(5, "\216\377\10\20\0\0\0\0\1\1\1\0\33\377\10\20\0\0\0\0\1\1\1\0_\377\10\20\0\0\0\0"..., 384, 0, NULL, NULL) = 384
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=5, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=5, revents=POLLOUT}])
writev(5, [{"\220\21\3\0\3\0G\0\0\30\0\0", 12}, {NULL, 0}, {"", 0}], 3) = 12
poll([{fd=5, events=POLLIN}], 1, -1) = 1 ([{fd=5, revents=POLLIN}])
recvfrom(5, "\1\3\306\1\16\0\0\0\0\30\0\0\10\377\31\1\377\37\10\370\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096, 0, NULL, NULL) = 88
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=5, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=5, revents=POLLOUT}])
writev(5, [{"\20\0\3\0\4\0G\0Meta", 12}, {NULL, 0}, {"", 0}], 3) = 12
poll([{fd=5, events=POLLIN}], 1, -1) = 1 ([{fd=5, revents=POLLIN}])
recvfrom(5, "\1\0\307\1\0\0\0\0\206\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 4096, 0, NULL, NULL) = 32
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=5, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=5, revents=POLLOUT}])
writev(5, [{"\20\0\4\0\5\0G\0Super\0\0\0", 16}, {NULL, 0}, {"", 0}], 3) = 16
poll([{fd=5, events=POLLIN}], 1, -1) = 1 ([{fd=5, revents=POLLIN}])
recvfrom(5, "\1\0\310\1\0\0\0\0\207\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 4096, 0, NULL, NULL) = 32
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=5, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=5, revents=POLLOUT}])
writev(5, [{"\20\0\4\0\5\0G\0Hyper\0\0\0", 16}, {NULL, 0}, {"", 0}], 3) = 16
poll([{fd=5, events=POLLIN}], 1, -1) = 1 ([{fd=5, revents=POLLIN}])
recvfrom(5, "\1\0\311\1\0\0\0\0\210\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 4096, 0, NULL, NULL) = 32
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=5, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=5, revents=POLLOUT}])
writev(5, [{";\3\5\0\16\0 \1\0\0\0\0\3\0\3\0\316\2\22\0008\0\5\0\16\0 \1\0000\0\0"..., 16384}, {NULL, 0}, {"", 0}], 3) = 16384
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=5, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=5, revents=POLLOUT}])
writev(5, [{"6\3\2\0f\0 \1", 8}, {NULL, 0}, {"", 0}], 3) = 8
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}], 2, 0) = 0 (Timeout)
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}], 2, 0) = 0 (Timeout)
poll([{fd=5, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=5, revents=POLLOUT}])
writev(5, [{"5\30\4\0\200\0 \1\3\0 \1\316\2\22\0\223\4\5\0\201\0 \1\200\0 \1)\0\0\0"..., 296}, {NULL, 0}, {"", 0}], 3) = 296
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}], 2, 497) = 0 (Timeout)
poll([{fd=5, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=5, revents=POLLOUT}])
writev(5, [{"(\30\4\0\3\0 \1\1\1\0\0\0\0\0\0", 16}, {NULL, 0}, {"", 0}], 3) = 16
poll([{fd=5, events=POLLIN}], 1, -1) = 1 ([{fd=5, revents=POLLIN}])
recvfrom(5, "\1\1#\2\0\0\0\0\250\3\300\0o\0N\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 4096, 0, NULL, NULL) = 32
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}], 2, 4498) = 0 (Timeout)
futex(0x7f2d8af5ea9c, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x7f2d8af5ea98, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1
recvfrom(5, 0x25ff6c4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)