我有一个相当复杂的GUI,通过在
linux上运行的
python的tkinter编写,其中一个组件(具有经常更新的Text小部件)导致GUI不经常崩溃(每天一次).
通过X11和Gnome 2.28.2在Mac OSX上运行的guis显示为具有相同的行为.我的python版本是3.3,tk / tcl版本是8.5.我得到的错误是:
X Error of Failed request: BadIDChoice (invalid resource ID chosen for this connection) Major opcode of Failed request: 148 (RENDER) Minor opcode of Failed request: 4 (RenderCreatePicture) Resource id in Failed request: 0x116517f Serial number of Failed request: 15106831 Current serial number in output stream: 15106872
一个strace看起来像:
11:03:29.632041 recvfrom(13,0x3bae1d4,4096,0) = -1 EAGAIN (Resource temporarily unavailable) 11:03:29.632059 recvfrom(13,0) = -1 EAGAIN (Resource temporarily unavailable) 11:03:29.632147 poll([{fd=13,events=POLLIN|POLLOUT}],1,-1) = 1 ([{fd=13,revents=POLLOUT}]) 11:03:29.632164 writev(13,[{"\224\4\5\0D\304\361\0\17\274\361\0i\4\0\0\0\0\0\0\224\27\n\0\3\f\340\0\301\v\340\0"...,5032},{NULL,0},{"",0}],3) = 5032 11:03:29.632193 poll([{fd=13,events=POLLIN}],revents=POLLIN}]) 11:03:29.637040 recvfrom(13,"\0\16\302\276x\304\361\0\4\0\224\0\1\0\0\0`\16\330\3\1\0\0\0\243\304\342\210\377\177\0\0"...,NULL,NULL) = 136 11:03:29.637135 open("/usr/share/X11/XErrorDB",O_RDONLY) = 35 11:03:29.637217 fstat(35,{st_mode=S_IFREG|0644,st_size=41532,...}) = 0 11:03:29.637360 read(35,"!\n! Copyright 1993,1995,1998 "...,41532) = 41532 11:03:29.637387 close(35) = 0 11:03:29.637820 write(2,"X Error of Failed request: BadI"...,91) = 91 ...
我的GUI是单线程的(并使用after()调用来监视I / O的套接字).
有谁知道什么可能是错的?有没有更好的调试,我可以做出来找出X错误部分的含义?
解决方法
使用以下日志偶尔崩溃(每天一次)……
X Error of Failed request: BadIDChoice (invalid resource ID chosen for this connection) Major opcode of Failed request: 148 (RENDER) Minor opcode of Failed request: 4 (RenderCreatePicture)
…似乎是xcb中已知问题的标志性签名,如下面的线程中的mentioned:
07001
它的补丁可以在here获得.
根据git历史记录,这个xcb bug应该在libX11-1.1.99.2及更高版本(〜8年前)中修复.
有关进一步参考,请参见email-thread with the complete discussion.