Bug 473863 - After long-term use, running new programs becomes impossible because no Qt platform plugin could be initialized
Summary: After long-term use, running new programs becomes impossible because no Qt pl...
Status: RESOLVED UPSTREAM
Alias: None
Product: plasma-integration
Classification: Plasma
Component: general (show other bugs)
Version: 5.27.7
Platform: Manjaro Linux
: NOR major
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-28 16:45 UTC by alerikaisattera
Modified: 2024-01-18 21:44 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description alerikaisattera 2023-08-28 16:45:18 UTC
SUMMARY
After running KDE Plasma for long time (multiple days), starting new programs within graphical environment is no longer possible


STEPS TO REPRODUCE
1. Run KDE Plasma for a few days
2. At some moment, running new programs becomes impossible

OBSERVED RESULT
At some moment, running new programs becomes impossible

EXPECTED RESULT
This should not happen

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version: 5.27.7
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.10

ADDITIONAL INFORMATION
Following log messages can be found after trying to run a program:
"Authorization required, but no authorization protocol specified" from kglobalaccel5
"qt.qpa.xcb: could not connect to display :0"
"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, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb." from relevant program
and a crash message
Comment 1 Nate Graham 2023-08-28 19:35:10 UTC
What distro are you using?

How was the system installed?

have you applied any customizations to the system? Any non-default configs, software built from source, environment variables added manually, etc?
Comment 2 alerikaisattera 2023-08-29 07:07:54 UTC
Manjaro

Installed the standard way

I have GTK_USE_PORTAL=1, but I didn't have it the first time this was noticed
Comment 3 Nate Graham 2023-08-29 15:49:55 UTC
Thanks. Dunno what could cause this.
Comment 4 alerikaisattera 2023-09-08 16:37:20 UTC
Attempting to restart kglobalaccel5 with systemctl --user restart plasma-kglobalaccel.service fails with errors:

plasma-kglobalaccel.service: Main process exited, code=dumped, status=6/ABRT
plasma-kglobalaccel.service: Failed with result 'core-dump'.
Failed to start KDE Global Shortcuts Server.
plasma-kglobalaccel.service: Scheduled restart job, restart counter is at 5.
Stopped KDE Global Shortcuts Server.
plasma-kglobalaccel.service: Start request repeated too quickly.
plasma-kglobalaccel.service: Failed with result 'core-dump'.
Failed to start KDE Global Shortcuts Server.
Comment 6 alerikaisattera 2023-09-08 18:25:54 UTC
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007fb525c8e8a3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007fb525c3e668 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007fb525c264b8 in __GI_abort () at abort.c:79
#4  0x00007fb5264a0098 in qt_message_fatal (message=<synthetic pointer>..., context=...) at global/qlogging.cpp:1919
#5  QMessageLogger::fatal (this=<optimized out>, msg=<optimized out>) at global/qlogging.cpp:898
#6  0x00007fb526b3f3f2 in QGuiApplicationPrivate::createPlatformIntegration() () from /usr/lib/libQt5Gui.so.5
#7  0x00007fb526b3fa69 in QGuiApplicationPrivate::createEventDispatcher() () from /usr/lib/libQt5Gui.so.5
#8  0x00007fb52669c195 in QCoreApplicationPrivate::init (this=0x5593fe298ad0) at kernel/qcoreapplication.cpp:835
#9  0x00007fb526b3fb16 in QGuiApplicationPrivate::init() () from /usr/lib/libQt5Gui.so.5
#10 0x00007fb526b4084c in QGuiApplication::QGuiApplication(int&, char**, int) () from /usr/lib/libQt5Gui.so.5
#11 0x00005593fe0e60a2 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kglobalaccel/kglobalaccel-5.109.0/src/runtime/main.cpp:41
Comment 7 alerikaisattera 2023-11-22 09:24:19 UTC
"Authorization required, but no authorization protocol specified" is the key part of this bug. Everything else follows from it
Comment 8 fanzhuyifan 2023-11-22 17:49:40 UTC
Could it be an updated system that has not been restarted?
Comment 9 alerikaisattera 2023-11-23 08:04:04 UTC
This happens inevitably after using for a few days, regardless of updating
Comment 10 alerikaisattera 2024-01-18 11:33:14 UTC
So, here's what happens: there is an xauth file located in /tmp, which can be erased when systemd.tmpfiles-clean.service is executed, causing this bug. Manual removal of the xauth file reproduces this bug, and copying the file before it is deleted and restoring it fixes it.

Fixing it completely would require some mechanism to prevent systemd.tmpfiles-clean.service from erasing the xauth file
Comment 11 Nate Graham 2024-01-18 21:44:23 UTC
Fascinating. And equally unrelated to KDE. :) I'd recommend following up with your distro.