麒麟系统图形卡死问题分析
- 问题现象
飞腾平台麒麟系统,qt图形应用软件运行若干天后,桌面图形卡住鼠标键盘点击无响应。
- 问题分析
- 桌面任务栏时间刷新正常,表明桌面显示应该是正常的。xserver总体正常。
- xdpyinfo显示当前focus 窗口,screen信息,扩展信息等,表明display相关正常。
- 使用xwininfo显示focus窗口为”SmartIC”用户程序窗口。
- 使用xprop显示”SmartIC”窗口更多窗口管理状态等信息,正常。
- 通过应用接口来控制窗口,失败。表明应用去跟xserver通信异常,不过中间还要过一道窗口管理器,所以进一步分析窗口管理器与xserver间的通信是否有问题。
- 通过wmctrl(窗口管理器相关)操作窗口,发现能进行窗口置顶等操作,但窗口无法进行焦点输入操作,表明窗口管理器并未完全失去窗口的控制。
- 使用XGetInputFocus查看input focus窗口正常。
- 分析日志,发现三月一号在屏保之后显示图形时,在操作时,所有窗口都报出问题,截图如下:

明显发现timestamp有问题,部分时间戳对比不符合常理,看起来似乎有溢出,如:
![]()
在社区发现类似问题,如下:
GUI hangs when system is up for (multiple of) 50 days
When uptime crosses a multiple of 2^32 milliseconds (~49.7 days), windows stop responding to keyboard and mouse events. Restarting X clears the problem (until the uptime passes another ~49.7 days). This was originally observed with gnome-session, but it is also observable in mutter, and the latter was easier to test.
Here is my basic testing process. As it is difficult to manipulate the system's monotonic clock, I used a hacked version of the Xorg server that would use "wall" time for its clock instead of the system's monotonic clock. With this "wall" clock, an overflow/wrap-around event occurs around Jan 16 2018 17:24:15 UTC.
- Set the date to a few minutes before the overflow time
- Start up [hacked] Xorg
- Start up mutter
- Start up a couple of regular X clients (e.g. xterm, xlogo)
- Hit
Alt-Tabseveral times to switch between windows - Wait fot the clock overflow event to pass
- Hit
Alt-Tabseveral times to switch between windows
相关patch如下:
src/backends/x11/meta-backend-x11.c
@@ -112,7 +112,7 @@ translate_device_event (MetaBackendX11 *x11,
if (!device_event->send_event && device_event->time != CurrentTime) {
-if (device_event->time < priv->latest_evtime)
+if (XSERVER_TIME_IS_BEFORE (device_event->time, priv->latest_evtime)) {
现象与报错与现场一致,而且出问题时间等吻合。查看源码后确认相关patch没有被打上,查看后续mutter版本,此patch后续集成到主线了。综上初步能判断,是同一问题。