简体   繁体   中英

Running Qt GUI Application on VNC cause Segmentation Fault with error message

I'm trying to run a Qt 5.8 GUI application in vncviewer and I'm getting a segmentation fault.

System Configuration

Qt 5.8

Ubuntu 17.04

vncserver

Xvnc Free Edition 4.1.1 - built Feb 25 2015 23:02:21

vncviewer

TigerVNC Viewer 64-bit v1.7.0

VNC xstartup script contents:

#!/bin/sh

export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS

xfce4-panel &
xfsettingsd &
xfwm4 &
xfdesktop &
pcmanfm &
xfce4-terminal &

Error Message:

$ ./MyApp 
QXcbConnection: Failed to initialize XRandr
Segmentation fault (core dumped)

Core Dump Note: Had to change some paths, app names, and omissions for brevity.

(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

This only happens in vncviewer of remote desktop. On the local system it runs as expected.

Please let me know if there are any workarounds.

The application needs an OpenGL context for the rendering process. It looks like it is not available on your server.

If you are running the application via ssh, try to run it with the graphical user interface integration:

ssh -X ...

This is needed because by default Qt's use the xcb backend on Linux so it needs an active X session to show something.

If it does not work, you may need to check the OpengGL support of the distribution/configuration you are running in your server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM