在VNC上运行Qt GUI应用程序导致分段错误,并显示错误消息
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在VNC上运行Qt GUI应用程序导致分段错误,并显示错误消息相关的知识,希望对你有一定的参考价值。
我正在尝试在vncviewer中运行Qt 5.8 GUI应用程序,我遇到了分段错误。
系统配置
Qt 5.8
Ubuntu 17.04
的vncserver
Xvnc免费版4.1.1 - 建于2015年2月25日23:02:21
的vncviewer
TigerVNC Viewer 64位v1.7.0
VNC xstartup脚本内容:
#!/bin/sh
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
xfce4-panel &
xfsettingsd &
xfwm4 &
xfdesktop &
pcmanfm &
xfce4-terminal &
错误信息:
$ ./MyApp
QXcbConnection: Failed to initialize XRandr
Segmentation fault (core dumped)
核心转储注意:为简洁起见,必须更改一些路径,应用程序名称和遗漏。
(gdb) run
Starting program: $HOME/MyApp
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe2023700 (LWP 5917)]
QXcbConnection: Failed to initialize XRandr
[New Thread 0x7fffd5cbc700 (LWP 5918)]
...
[omitted for brevity]
...
[New Thread 0x7fff6b32a700 (LWP 5945)]
Thread 23 "Chrome_InProcGp" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff8d7fa700 (LWP 5942)]
0x00007ffff081abba in ?? () from /opt/Qt5.8.0/5.8/gcc_64/lib/libQt5WebEngineCore.so.5
(gdb) bt
#0 0x00007ffff081abba in () at /opt/Qt5.8.0/5.8/gcc_64/lib/libQt5WebEngineCore.so.5
#1 0x00007ffff081b4bc in () at /opt/Qt5.8.0/5.8/gcc_64/lib/libQt5WebEngineCore.so.5
#2 0x00007ffff1a51d54 in () at /opt/Qt5.8.0/5.8/gcc_64/lib/libQt5WebEngineCore.so.5
#3 0x00007ffff1a54478 in () at /opt/Qt5.8.0/5.8/gcc_64/lib/libQt5WebEngineCore.so.5
#4 0x00007ffff1a55589 in () at /opt/Qt5.8.0/5.8/gcc_64/lib/libQt5WebEngineCore.so.5
#5 0x00007ffff1a4ffd0 in () at /opt/Qt5.8.0/5.8/gcc_64/lib/libQt5WebEngineCore.so.5
#6 0x00007ffff1a5024e in () at /opt/Qt5.8.0/5.8/gcc_64/lib/libQt5WebEngineCore.so.5
#7 0x00007ffff1a50969 in () at /opt/Qt5.8.0/5.8/gcc_64/lib/libQt5WebEngineCore.so.5
#8 0x00007ffff1a51225 in () at /opt/Qt5.8.0/5.8/gcc_64/lib/libQt5WebEngineCore.so.5
#9 0x00007ffff1a512f3 in () at /opt/Qt5.8.0/5.8/gcc_64/lib/libQt5WebEngineCore.so.5
#10 0x00007ffff19f725d in () at /opt/Qt5.8.0/5.8/gcc_64/lib/libQt5WebEngineCore.so.5
#11 0x00007ffff19a5dbe in () at /opt/Qt5.8.0/5.8/gcc_64/lib/libQt5WebEngineCore.so.5
#12 0x00007ffff19a694d in () at /opt/Qt5.8.0/5.8/gcc_64/lib/libQt5WebEngineCore.so.5
#13 0x00007ffff19a6c1b in () at /opt/Qt5.8.0/5.8/gcc_64/lib/libQt5WebEngineCore.so.5
#14 0x00007ffff19a8559 in () at /opt/Qt5.8.0/5.8/gcc_64/lib/libQt5WebEngineCore.so.5
#15 0x00007ffff19bb18a in () at /opt/Qt5.8.0/5.8/gcc_64/lib/libQt5WebEngineCore.so.5
#16 0x00007ffff19d0c05 in () at /opt/Qt5.8.0/5.8/gcc_64/lib/libQt5WebEngineCore.so.5
#17 0x00007ffff19d0de7 in () at /opt/Qt5.8.0/5.8/gcc_64/lib/libQt5WebEngineCore.so.5
#18 0x00007ffff19cd76d in () at /opt/Qt5.8.0/5.8/gcc_64/lib/libQt5WebEngineCore.so.5
#19 0x00007ffff7bc06da in start_thread (arg=0x7fff8d7fa700) at pthread_create.c:456
#20 0x00007fffef6aad7f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105
这只发生在远程桌面的vncviewer中。在本地系统上,它按预期运行。
如果有任何解决方法,请告诉我。
答案
该应用程序需要OpenGL context进行渲染过程。看起来它在您的服务器上不可用。
如果您通过ssh运行应用程序,请尝试使用图形用户界面集成来运行它:
ssh -X ...
这是必需的,因为默认情况下,Qt在Linux上使用xcb后端,因此它需要一个活动的X会话来显示内容。
如果它不起作用,您可能需要检查服务器中正在运行的分发/配置的OpengL支持。
以上是关于在VNC上运行Qt GUI应用程序导致分段错误,并显示错误消息的主要内容,如果未能解决你的问题,请参考以下文章