pcsx2 icon indicating copy to clipboard operation
pcsx2 copied to clipboard

[BUG]: Crash when $DISPLAY is unset

Open NetSysFire opened this issue 1 year ago • 1 comments

Describe the Bug

When you run it from the terminal while DISPLAY is unset, there will be a couple of errors and eventually a crash.

Reproduction Steps

  1. unset DISPLAY (happens when you e.g ssh into your machine or do not have a graphical environment started)
  2. run the emulator.
  3. crash.
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vkkhrdisplay, vnc, wayland-egl, wayland, xcb.

zsh: IOT instruction (core dumped)  pcsx2-qt

Expected Behavior

Proper error handling. Related to #5504. This is obviously not a critical bug and should therefore probably get a lower priority. It may also be a good first issue since checking if the value is empty looks easy enough.

PCSX2 Revision

v1.7.0.dev.r4039.g30142eb26-1

Operating System

Linux (64bit) - Specify Distro Below

If Linux - Specify Distro

Arch Linux

NetSysFire avatar Aug 04 '22 18:08 NetSysFire

The real fix would obviously be just a proper error handle but. It would be kinda of a neat / niche feature to have pcsx2 force an xserver or wayland session and grab $DISPLAY from that

weirdbeardgame avatar Aug 04 '22 18:08 weirdbeardgame

Won't fix. The abort() is raised by Qt, not us. I guess you could report it to them.

(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff5a3c406 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff5a2287c in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff62b0a92 in qAbort() () from /home/user/deps/lib/libQt6Core.so.6
#6  0x00007ffff62b13dd in QMessageLogger::fatal(char const*, ...) const () from /home/user/deps/lib/libQt6Core.so.6
#7  0x00007ffff6b0051d in init_platform(QString const&, QString const&, QString const&, int&, char**) [clone .cold] ()
   from /home/user/deps/lib/libQt6Gui.so.6
#8  0x00007ffff6b97648 in QGuiApplicationPrivate::createPlatformIntegration() ()
   from /home/user/deps/lib/libQt6Gui.so.6
#9  0x00007ffff6b981d8 in QGuiApplicationPrivate::createEventDispatcher() () from /home/user/deps/lib/libQt6Gui.so.6
#10 0x00007ffff634dc25 in QCoreApplicationPrivate::init() () from /home/user/deps/lib/libQt6Core.so.6
#11 0x00007ffff6b9b610 in QGuiApplicationPrivate::init() () from /home/user/deps/lib/libQt6Gui.so.6
#12 0x00007ffff798cbcd in QApplicationPrivate::init() () from /home/user/deps/lib/libQt6Widgets.so.6
#13 0x00005555556f7ea5 in main (argc=1, argv=0x7fffffffe328) at /home/user/dev/pcsx2/pcsx2-qt/QtHost.cpp:1845

stenzek avatar Sep 24 '23 02:09 stenzek